PDA

View Full Version : Qcombobox



Project25
16th December 2009, 19:30
Hi I have Combobox1 with list of few items. Then I have combobox2 with list of selectable items. If I select any item from combobox1 and I would like to save and later retrieve the current settings of item that I selected in combobox2. Should I use stackwidget for Combobox2?
For instance

Combobox1 menu have four items:- Combobox2 drop down menu have 3items
Test1 Left
Test2 Right
Test3 Bottom
Test4

Now if i select Test1 from Combobox1 and then I select Right from Combobox2. I like to save "Right" selection for test1 selection of Combobox1 and same way if select Test3 I like to save another selection for combobox2. When I select anything from combobox1 i like to save some settings of combobox2 based on index or value of combobox1.

Lykurg
16th December 2009, 20:14
use a QHash to store the informations.
E.g.:

QHash<int,int> state;
state[0] = 1;
0 = index 0 of combo box 1
1 = index of combo box 2
and so on.

Project25
16th December 2009, 20:29
thanks lykurg. Just found QHash or QMap