我有一個combox,並且想要將框中選擇的值添加到變量中。變量。我從文檔中嘗試了一些東西,只是將它設置爲Qlabel才成功。任何幫助,請PYQT Qcombobox設置的值被選爲一個變量
self.languageLbl = QtGui.QLabel("Download_IVR", self)
comboBox = QtGui.QComboBox(self)
comboBox.addItem("IVR_ITALY")
comboBox.addItem("IVR_FRANCE")
comboBox.addItem("IVR_SPAIN")
comboBox.addItem("IVR_GERMANY")
comboBox.move(650, 250)
comboBox.resize(150,40)
self.languageLbl.move(650,150)
comboBox.activated[str].connect(self.languageChoice)
def download_button(self):
ivrLang = self.comboBox.currentText()
我想ivrLang設置在下拉列表中選擇的項目。謝謝!
謝謝主席先生的努力 – Anekdotin