PDA

View Full Version : QComboBox display a color square in the currently selected item



frankiefrank
1st September 2011, 16:20
I have a color selection QComboBox, I populate the items same as this sample suggests:
http://doc.trolltech.com/4.5/itemviews-coloreditorfactory.html

Using Qt::Decoration shows the nice color squares for each item. The problem is that when the combo box is "closed" (After an item was selected) there is no indication of the selected color. I just have the name.

Is there a way to make the selected color square displayed in the combo in its "idle" mode?