PDA

View Full Version : Delayed Password Masking



branko
19th March 2010, 16:29
Hi everybody,
I would really appreciate your help.

I need to have delayed password masking in my application for the login screen. This means that my password field (QLineEdit) shoud mask all entered characters with a certain delay (passwords get masked while typing but the last character in row is shown)

All suggestions appreciated!
Thanks in advance,
Branko

Lykurg
19th March 2010, 19:48
Subclass QLineEdit, fetch the key press (QLineEdit::keyPressEvent()), "encrypt" the last input, append the just entered letter plain, start a timer and after the timer expires also crypt the inserted letter... No big deal

branko
22nd March 2010, 14:37
Hi Lykurg,

Thank you very much for answering my email. Yes, this sounds like a correct approach and I thought to do it that way, but I have had no idea how to deal with adding/deleting characters from the beginning or somewhere from the middle of my password field. That’s why I thought there might a Qt built-in solution for this type of password entry, but obviously there is no one. Do you have any suggestions regarding this issue (adding/deleting characters from the middle)?

Best regards,
Branko

branko
22nd March 2010, 15:21
Maybe there is no need to support adding/deleting characters from the middle :)

Lykurg
22nd March 2010, 16:04
Maybe there is no need to support adding/deleting characters from the middle :)
Yes, its unlikely that somone add a charakter anywhere inside "*****************". I guess, but in case one could use cursorPosition() to determinate the position where to enter the charakter.

branko
23rd March 2010, 09:32
Thank you very much! I'll do it this way if necessary. I really appreciate your help, thanks a lot!