Hi,

I have a LineEdit for a password which has to be numeric and max. lenght is 8. Also it has to display asterisks or dots as I see it does with my code. My problem is that if I put the next code when I write the 9th digit which should not let you to, it ERASES all the lineedit and writtes it as the first one. O.o Why do I have this behaviour?

Qt Code:
  1. QRegExp rx212("[0-9]{0,8}");
  2. QValidator *validator212 = new QRegExpValidator(rx212, this);
  3.  
  4. // this both lines make it goes wrong
  5. le_Pwd->setValidator(validator212); // this line alone allows me to put 0-8 numbers, no more. This is what I want but mask with ******
  6. le_Pwd->setEchoMode(QLineEdit::Password); // this line alone allows me to show dots instead of numbers to mask the pwd. with no limit
To copy to clipboard, switch view to plain text mode 
Thank you!