Masking QLineEdit text

后端 未结 5 1007
灰色年华
灰色年华 2021-02-06 11:53

I am using PyQt4 QLineEdit widget to accept password. There is a setMasking property, but not following how to set the masking character.<

5条回答
  •  难免孤独
    2021-02-06 12:55

    In Qt Designer

    Select the line edit, and in the Property Editor window, there will be a property echoMode which you can set to Password.

    Using python code

    In this case, Anti Earth's answer will work which is:

    myLineEdit.setEchoMode(QLineEdit.Password)
    

提交回复
热议问题