I’m using Python 3 and QT4 with pyqt. I’m using Designer. I’ve been unable to access data from qcomboboxes and qplaintextedits.
I’ve read the documentation here: http://qt-project.org/doc/qt-4.8/qcombobox.html http://qt-project.org/doc/qt-4.8/qplaintextedit.html
The only thing on these pages that appears to describe how to pull the selected value are ‘plainText’ for the plain text box and ‘currentText’ for the combo box. These aren’t explicitly described as the solution, but they’re the only thing I found that makes sense.
They do not return errors, but both the combo boxes and text boxes return the default value I set in QT designer, regardless of what is currently selected when running the program. Any ideas?
Example code I’m using:
x = window.ui.tb_x.toPlainText()
y = window.ui.cb_y.currentText()
I’ve also tried
y = window.ui.cb_y.itemData(window.ui.currentIndex())
↧