I’m having a problem with extracting data from multiple comboboxes at once. I have around 10 comboboxes in a container. I could extract the data individual but that would result in repeated code. This is what I have so far but doesn’t seem to work at all:
JavaScript
x
5
1
def extractData():
2
window.survey= window.surveyContainer.currentText()
3
for results in window.surveryContainer.children():
4
results.currentTextChanged.connect(extractData)
5
Advertisement
Answer
First of all you will need to have all the comboboxes you want to access on the same container (in this case I assume it is surveryContainer
), then you can do:
JavaScript
1
3
1
for results in window.surveryContainer.findChildren(QComboBox):
2
results.currentTextChanged.connect(extractData)
3