As far as I can see from examples on the Net, such as http://zetcode.com/gui/pyqt5/widgets2/ - a QComboBox needs to have .addItem()
called, so it actually adds an item in the dropdown.
So, if I have a Python list of options, in principle, I'd have to iterate over it, and to .addItem
on each item, for instance:
self.combo = QComboBox(self)
self.my_choices = ["Choice 1", "Choice A", "Choice 300" ]
for tchoice in self.my_choices:
self.combo.addItem(tchoice)
So, I'd just like to confirm - is there some sort of a mechanism, whereby I could specify that the combobox "binds" with a list - so that, afterwards, whenever I change the list (append to it, or remove from it, or change its items), the combo box content changes as well, with no further commands? (Otherwise, in principle, I have to clean the combobox entries, then repeat the above loop again, upon every change of the list).
If there is no such mechanism, just a "No" would be a very acceptable answer - I just wanted to confirm this.