'showing password in Qt
I am developing a Qt program.at first of it it has a login page.for entering the password in a QLineEdit when you enter the password it shows some dots as if it is hidden.I made a QCheckBox for showing password.but I don't know how to write it's SLOT that when it is checked the password shown.is there any Qt function?what should I do?
Solution 1:[1]
See QLineEdit's EchoMode and set it to the option that best fit your needs.
Solution 2:[2]
Other form.
#Create event
self.nameCheckbox.clicked.connect(self.click)
#Create def
def click(self): if(self.nameCheckbox.isChecked()): self.txtname.setEchoMode(QtWidgets.QLineEdit.Normal)
else: self.txtname.setEchoMode(QtWidgets.QLineEdit.Password)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Zlatomir |
| Solution 2 | jose 3 |
