PyQt -How do make my text have an asterisk on it?

passwords, pyqt, python

Solution

Call `LineEdit.setEchoMode` with `QtGui.QLineEdit.Password` as argument.

For example,

import sys

from PyQt4 import QtGui

app = QtGui.QApplication(sys.argv)
w = QtGui.QWidget()
le = QtGui.QLineEdit(w)
le.setEchoMode(QtGui.QLineEdit.Password)
le.show()
w.show()

sys.exit(app.exec_())

Problem

I have a password dialog and want to have the asterisk over the letter in pyqt in QLineEdit. is this possible i couldn't find anything online.

Original source