Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PyQt4.QtGui import *
- from PyQt4.QtCore import *
- class user_password(QWidget):
- def __init__(self):
- self.app = QApplication([])
- self.win = QWidget()
- self.main_layout = QVBoxLayout(self.win)
- self.form = QFormLayout()
- self.u_label = QLabel('User:')
- self.p_label = QLabel('Password:')
- self.u_edit = QLineEdit()
- self.p_edit = QLineEdit()
- self.ok = QPushButton('Submit')
- self.win.setWindowTitle('What\'s your password?')
- self.u_edit.setEchoMode(0)
- self.p_edit.setEchoMode(2) # password = asterisks
- self.form.addRow(self.u_label, self.u_edit)
- self.form.addRow(self.p_label, self.p_edit)
- self.main_layout.addLayout(self.form)
- self.main_layout.addWidget(self.ok)
- #self.ok.clicked.connect(self.print_values)
- self.connect(self.ok, SIGNAL('clicked()'), self.print_values)
- self.win.show()
- self.app.exec_()
- def print_values(self):
- print 'foo'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement