输入列表:
self.pushButton_5.clicked.connect(self.getitem)def getitem(self):items = ['C++','C']item, ok = QInputDialog.getItem(self,'输入语言','语言列表',items)if ok and item:self.pushButton_5.setText(item)
输入文本
self.pushButton_5.clicked.connect(self.gettext)def gettext(self):text, ok = QInputDialog.getText(self,'输入文本','输入')if ok and text:self.pushButton_5.setText(text)
输入数字
self.pushButton_5.clicked.connect(self.getint)def getint(self):num, ok = QInputDialog.getInt(self,'输入数字','输入')if ok and num:self.pushButton_5.setText(str(num))