I don't agree with that statement.First of all, the documentation does not state which data is being validated and when.
If you read the docs for QComboBox::validator() you will see:
So it tells me, that during text input (which es every time you edit the text) the validator will be applied, which, makes sense too.Returns the validator that is used to constrain text input for the combobox.
Now:
That is also in the docs, but you have to pay attention:Does the validation logic fire when I'm leaving focus, when I'm selecting an item from the existing list? When I'm calling addItem / insertItem programatically?
Since we are dealing with an editable QComboBox, it has a QLineEdit.
So it means, when you input text, you are doing the input in to it QLineEdit.
That means, that your validator is applied by the QLineEdit.
Lets see what we can find there:
Ok, I agree, that it doesn't answer your question in a nice one block, and that you have to apply some thought to see how this relates to your case.You can change the text with setText() or insert(). The text is retrieved with text(); the displayed text (which may be different, see EchoMode) is retrieved with displayText(). Text can be selected with setSelection() or selectAll(), and the selection can be cut(), copy()ied and paste()d. The text can be aligned with setAlignment().
When the text changes the textChanged() signal is emitted; when the text changes other than by calling setText() the textEdited() signal is emitted; when the cursor is moved the cursorPositionChanged() signal is emitted; and when the Return or Enter key is pressed the returnPressed() signal is emitted.
When editing is finished, either because the line edit lost focus or Return/Enter is pressed the editingFinished() signal is emitted.
Note that if there is a validator set on the line edit, the returnPressed()/editingFinished() signals will only be emitted if the validator returns QValidator::Acceptable.
But you can't expect the documentation to answer everything in the right way for each case.
But as you can see, the information is there, one just needs to invest in reading it ;-)
Hmm..I inherited from RegExpValidator but I don't really understand why I don't see it called:
How did you check to know if its being called?
Bookmarks