質問

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

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top