writing a username and password dialog
Hi Everybody!
I would like to write a dialog asking the user for a username and password.
My difficulty lays on the password stuff. what libraries and functions are relative to the keyboard in order to mask the written password or
showing "stars" instead of the typed letters.
I have been looking for the different forums without any success.
Thank you!
Serge
Re: writing a username and password dialog
You can use a QLineEdit and the setEchoMode( QLineEdit::Password ).
This way any characters you type in will be displayed as asterisks.
Regards
Re: writing a username and password dialog
Quote:
Originally Posted by
marcel
You can use a QLineEdit and the setEchoMode( QLineEdit::Password ).
This way any characters you type in will be displayed as asterisks.
Regards
Yes, I too agree with that. If possible try overriding QLineEdit and you can can have more command like setting maxCharacters etc
Re: writing a username and password dialog
Quote:
Originally Posted by
vermarajeev
If possible try overriding QLineEdit and you can can have more command like setting maxCharacters etc
QLineEdit::setMaxLength() ?
Re: writing a username and password dialog
Check out:
http://wiki.qtcentre.org/index.php?t...t4_and_C%2B%2B
About 1/3 the way down is an example of a login dialog and the necessary code.
That was the first program I wrote using C++ and QT. I'd do it differently now, making it more generic and reusable in other projects, but at least this is an example.
Re: writing a username and password dialog
Yes, and that is a QLineEdit with password echo mode set.
It can't get more clearer than this.
Regards