Hi,

I have set a validator as below for a QLineEdit, portLineedit.

QIntValidator* intValidator = new QIntValidator(0, 9999, this);
portLineedit->setValidator(intValidator);

I am setting the text in portLineedit using as QLineEdit::setText() as "Port" from a different function. Now when the portLineedit line edit is being enabled it contains the text "Port". Now I want to modify the text, the validation is not working I am being able to write letters other then integers also and to any number of letters.

The validation is working only when I am deleting the entire content of portLineedit first.

Is it the standard behavior? If not how to make this validation work?


Thanks and regards,