how to create show password button QTdesigner

Question:

how could i create a button that shows password in qtdesigner and python?

enter image description here

Asked By: Vitor

||

Answers:

Connect your button to a slot like this one:

@pyqtSlot()
def toggle_password_hint(self):
    if self.<yourQLineEdit>.echoMode() == QLineEdit.EchoMode.Normal:
        self.<yourQLineEdit>.setEchoMode(QLineEdit.EchoMode.Password)
    else:
         self.<yourQLineEdit>.setEchoMode(QLineEdit.EchoMode.Normal)
Answered By: ניר
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.