Mmmm... that was what I was afraid of... thas maybe it could be a bug... In which version was this bug fixed? where do you see this?
What u say about catch the input.. I already tried too with that:
in .h: class MyValidator2: public QValidator { public: MyValidator2(QObject* parent=nullptr): QValidator(parent) {} State validate(QString& input, int&) const override { if (input=="0" or input=="1" or input=="2" or input=="3" or input=="4" or input=="5" or input=="6" or input=="7" or input=="8" or input=="9") return QValidator::Acceptable; } }; in constructor .cpp: auto validator12 = new MyValidator2(parent); le_Pwd->setValidator(validator12); le_Pwd->setMaxLength(8); le_Pwd->setEchoMode(QLineEdit::Password);But if i write 1 and then 2, the first one is erased and it only allows me to write one number.... and I don't know if its the bug or if I did wrong the validator ...
EDIT: I tried also with:
class MyValidator2: public QValidator { public: MyValidator2(QObject* parent=nullptr): QValidator(parent) {} State validate(QString& input, int&) const override { static const char alphanum[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < sizeof(alphanum) - 1; ++i) { if (input == &alphanum[i]) return QValidator::Invalid; else return QValidator::Acceptable; } return QValidator::Acceptable; } };But either works...