I'm pretty embarassed, but i need to understand the sintax needed to build a for cycle to append 36 ComboBox text inputs into the same list. This is the code i used:
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow
from PyQt5 import uic
class Ui(QMainWindow):
def __init__(self):
super().__init__()
uic.loadUi("UI_psi.ui", self)
self.avanti_psi.clicked.connect(self.sdq_page)
self.avanti_psi.clicked.connect(self.psi_data)
def sdq_page(self):
uic.loadUi("UI_sdq.ui", self)
self.Avanti_sdq.clicked.connect(self.indici_page)
def indici_page(self):
uic.loadUi("UI_indici.ui", self)
print()
def psi_data(self):
psiData = []
psiData.append(self.psi_1.currentText())
psiData.append(self.psi_2.currentText())
psiData.append(self.psi_3.currentText())
print(psiData)
app = QApplication([])
window = Ui()
window.show()
app.exec()
I called the function "psi_data", and i feel really dumb adding all the ComboBox's current text as i did...but i can't figure out how to iterate every combobox in the UI_psi.ui and add em to the list psiData[]!