fafa
fafa

Reputation: 559

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:

enter image description here

Upvotes: 33

Views: 48026

Answers (1)

evnu
evnu

Reputation: 6680

setEchoMode (Documentation) for your object.

Example code:

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

You can do it from Qt Designer:

enter image description here

Upvotes: 87

Related Questions