我制作了一个登录表单,但是我不知道如何在密码字段中放入**。我只有:
self.textPass = QtGui.QLineEdit(self)
如jedwards所评论,请使用setEchoMode
method:
示例:
setEchoMode
另请参见from PyQt4 import QtGui, QtCore
app = QtGui.QApplication([])
pw = QtGui.QLineEdit()
pw.setEchoMode(QtGui.QLineEdit.Password)
pw.show()
app.exec_()
。
在PyQt5中:
QLineEdit.EchoMode
enum