glue.utils.qt.update_combobox(combo, labeldata, default_index=0)

Redefine the items in a QComboBox


widget : QComboBox

The widget to update

labeldata : sequence of N (label, data) tuples

The combobox will contain N items with the appropriate labels, and data set as the userData


combo : QComboBox

The updated input


If the current userData in the combo box matches any of labeldata, that selection will be retained. Otherwise, the first item will be selected.

Signals are disabled while the combo box is updated

The QComboBox is modified inplace