update_combobox

glue.utils.qt.update_combobox(combo, labeldata)[source]

Redefine the items in a QComboBox

Parameters:

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

Returns:

combo : QComboBox

The updated input

Notes

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