I have a dictionnary fields={} which contains some field names that I named the Qt comobox objects after. For example keys combobox1 and combobox2, both contain a list with values that I would like to add to the
fields={}
fields['combobox1']=['value1','someting else']
fields['combobox2']=['bla','another value']
for key,values in fields.items():
for value in values:
Qt_ui. _____key_____ .addItem(value)
what is the correct syntax for the last line, so that ____key____ is replaced with the keys from the dictionary? I tried ui.__getattribute__(key).addItem(value) but it does't seem to work. Any suggestions are appreciated.
TypeError: 'PySide.QtGui.QComboBox.addItem' called with wrong argument types:
PySide.QtGui.QComboBox.addItem(float)
Supported signatures:
PySide.QtGui.QComboBox.addItem(PySide.QtGui.QIcon, unicode, QVariant = QVariant())
PySide.QtGui.QComboBox.addItem(unicode, QVariant = QVariant())
ui.__getattribute__(key)part seems to work. It looks likevalueis seen as a float. Can you print it before callingQt_ui....?