Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Login(QDialog):
- def __init__(self, parent=None):
- self.contributors=['','A','B','C']
- super(Login, self).__init__(parent)
- self.nameLabel=QLabel(self)
- self.nameLabel.setText("Select Your name")
- self.nameLabel.setAlignment(Qt.AlignHCenter)
- self.cb=QComboBox(self)
- self.cb.setGeometry(QRect(40,40,491, 31))
- self.cb.setObjectName(("comboBox"))
- self.cb.addItems(self.contributors)
- self.cb.currentIndexChanged.connect(self.getEditor)
- self.buttonLogin = QPushButton('Login', self)
- self.buttonLogin.clicked.connect(self.close)
- layout = QVBoxLayout(self)
- layout.addWidget(self.nameLabel)
- layout.addWidget(self.cb)
- layout.addWidget(self.buttonLogin)
- self.resize(600,150)
- self.exec_()
- def getEditor(self):
- text=str(self.cb.currentText())
- return text
- if __name__ == '__main__':
- app = QApplication(sys.argv)
- login=Login()
Add Comment
Please, Sign In to add comment