chimby
16th January 2009, 22:37
I am fairly new to QT so I have what might be an easy question.
I have a QComboBox that needs to be populated by a table in my database. I would like to be able to programmatically select the combo box by the table ID from the database. Of course the combobox index does not match the table ID's. To solve that problem I created QMap<TableID, ComboBoxIndex>. Now I can programmatically select the correct value in the combo box by using the map. However, I don't know how to do a "reverse" map to get the TableID by looking at the ComboBoxIndex. Arrrr. Is this possible? Am I not approaching this correctly?
thanks.
I have a QComboBox that needs to be populated by a table in my database. I would like to be able to programmatically select the combo box by the table ID from the database. Of course the combobox index does not match the table ID's. To solve that problem I created QMap<TableID, ComboBoxIndex>. Now I can programmatically select the correct value in the combo box by using the map. However, I don't know how to do a "reverse" map to get the TableID by looking at the ComboBoxIndex. Arrrr. Is this possible? Am I not approaching this correctly?
thanks.