I use Qt Designer (well, actually, Qt Creator, but specifically the part obtained from Qt Designer), and I added several QComboBox elements to the dialog with a constant list of elements. I need to map items in a combo box to strings (which are different from the displayed strings). The best idea I came up with is to use the QComboBox :: itemData function to get the desired row from the selected item, but I am unable to add the related rows to the items. I looked at the designer and have not yet seen a way to add user data. Is there anything that I miss? I also want to edit the XML of the .ui file directly to add a property if necessary, but I cannot figure out what the name of the property will be. Is there one that I can use here? I am currently adding data to code,but this does not seem to be the right solution for me.
source
share