PyQt中的密码形式

问题描述 投票:8回答:2

我制作了一个登录表单,但是我不知道如何在密码字段中放入**。我只有:

self.textPass = QtGui.QLineEdit(self)
python pyqt
2个回答
19
投票

如jedwards所评论,请使用setEchoMode method

示例:

setEchoMode

另请参见from PyQt4 import QtGui, QtCore app = QtGui.QApplication([]) pw = QtGui.QLineEdit() pw.setEchoMode(QtGui.QLineEdit.Password) pw.show() app.exec_()


0
投票
© www.soinside.com 2019 - 2024. All rights reserved.