You should use setItemData
, itemData
and findData
methods of QComboBox
. It allows to attach arbitrary QVariant
value to each item.
How to store an Id beside text and icon in a QComboBox?
题
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
解决方案
不隶属于 StackOverflow