Guest User

Untitled

a guest
Mar 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. class Login(QDialog):
  2. def __init__(self, parent=None):
  3.  
  4. self.contributors=['','A','B','C']
  5. super(Login, self).__init__(parent)
  6. self.nameLabel=QLabel(self)
  7. self.nameLabel.setText("Select Your name")
  8. self.nameLabel.setAlignment(Qt.AlignHCenter)
  9. self.cb=QComboBox(self)
  10. self.cb.setGeometry(QRect(40,40,491, 31))
  11. self.cb.setObjectName(("comboBox"))
  12. self.cb.addItems(self.contributors)
  13. self.cb.currentIndexChanged.connect(self.getEditor)
  14. self.buttonLogin = QPushButton('Login', self)
  15. self.buttonLogin.clicked.connect(self.close)
  16. layout = QVBoxLayout(self)
  17. layout.addWidget(self.nameLabel)
  18. layout.addWidget(self.cb)
  19. layout.addWidget(self.buttonLogin)
  20. self.resize(600,150)
  21. self.exec_()
  22.  
  23. def getEditor(self):
  24. text=str(self.cb.currentText())
  25. return text
  26.  
  27. if __name__ == '__main__':
  28. app = QApplication(sys.argv)
  29. login=Login()
Add Comment
Please, Sign In to add comment