开发者

Using QLineEdit for passwords

How can I 开发者_开发百科make a QLineEdit suitable for entering passwords (i.e. it doesn't show what's entered), something like the follwing:

Using QLineEdit for passwords


setEchoMode (Documentation) for your object.

Example code:

ui->lineEditPassword->setEchoMode(QLineEdit::Password);

You can do it from Qt Designer:

Using QLineEdit for passwords


Use setEchoMode and QLineEdit::Password

passwordField->setEchoMode(QLineEdit::Password);


You can using below command to hide text in lineEdit

ui->lineEditPassword->setEchoMode(QLineEdit::Password);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜