开发者

Using QLineEdit for passwords

开发者 https://www.devze.com 2023-03-01 19:22 出处:网络
How can I 开发者_开发百科make a QLineEdit suitable for entering passwords (i.e. it doesn\'t show what\'s entered), something like the follwing:

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

精彩评论

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