Search code examples
qtqlineedit

Trim a QLineEdit automatically: possible?


I wanted to limit the input of QLineEdit: no leading space. Is that possible ?

I shouldn't be using, e.g. the textEdited() signal, right ?


Solution

  • You can use the editingFinished() signal for that, it will be triggered when the text input loses focus or the user presses the enter key.