Question

is it possible to store some additional data in a QComboBox? I would like to store the Id of a data set beside its caption/name in a combobox, but it shouldnt show up (Ids can be some how cryptic and might confuse the user)

Any ideas?

Thanks in advance,

Ben

Was it helpful?

Solution

You should use setItemData, itemData and findData methods of QComboBox. It allows to attach arbitrary QVariant value to each item.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top