How can I make a QLineEdit
suitable for entering passwords (i.e. it doesn't show what's entered), something like the follwing:
Asked
Active
Viewed 4.3k times
3 Answers
82
setEchoMode
(Documentation) for your object.
Example code:
ui->lineEditPassword->setEchoMode(QLineEdit::Password);
You can do it from Qt Designer:
11
Use setEchoMode
and QLineEdit::Password
passwordField->setEchoMode(QLineEdit::Password);
4
You can using below command to hide text in lineEdit
ui->lineEditPassword->setEchoMode(QLineEdit::Password);

Donald Duck
- 8,409
- 22
- 75
- 99

thacngoc
- 49
- 1
- 2
-
This exact answer has already been submitted by someone else. Please try to avoid duplicate answers. – Yun Sep 05 '21 at 07:09