Using QLineEdit for passwords
setEchoMode (Documentation) for your object. Example code: ui->lineEditPassword->setEchoMode(QLineEdit::Password); You can do it from Qt Designer:
setEchoMode (Documentation) for your object. Example code: ui->lineEditPassword->setEchoMode(QLineEdit::Password); You can do it from Qt Designer:
My first suggestion is to use Qt Designer to create your GUIs. Typing them out yourself sucks, takes more time, and you will definitely make more mistakes than Qt Designer. Here are some PyQt tutorials to help get you on the right track. The first one in the list is where you should start. A … Read more
For the QLineEdit connect to the returnPressed signal. Alternatively, if you use the setAutoDefault method on your QPushButtons you emit the clicked signal when Enter is pressed on a focused QPushButton: #!/usr/bin/env python #-*- coding:utf-8 -*- import sip sip.setapi(‘QString’, 2) sip.setapi(‘QVariant’, 2) from PyQt4 import QtGui, QtCore class MyWindow(QtGui.QWidget): def __init__(self, parent=None): super(MyWindow, self).__init__(parent) self.pushButtonOK … Read more
QLineEdit::setValidator(), for example: myLineEdit->setValidator( new QIntValidator(0, 100, this) ); or myLineEdit->setValidator( new QDoubleValidator(0, 100, 2, this) ); See: QIntValidator, QDoubleValidator, QLineEdit::setValidator