comboBox and setInvertSelected

thierryg

08-06-2016 14:17:27

Hi,

I'm using setInvertSelected(true) with my comboBoxes.

When I'm using layouts from the layout Editor, it works perfectly :




But when I'm creating comboBox by code, it doesn't.
In my game, I'm clearing and re-creating the comboBox items, depending of the game assets, like this :
wave_particules->removeAllItems();
wave_particules->addItem(itbbp->second->screenName);


And, as a result, no item are invertSelected at all :



Am I doing something wrong ?
T.

thierryg

11-06-2016 09:37:07

Ok, I found the solution for my problem:

I was using a loop to populate the comboBox and I was selecting the current item inside the same loop. I guess adding a new item after the selected one reset the comboBox.
If I populate the list, THEN select the current item, it works perfectly.

T.