Results 1 to 3 of 3

Thread: Qcombobox

  1. #1
    Join Date
    Mar 2007
    Posts
    15
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Qcombobox

    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
    Qt Code:
    1. Combobox1 menu have four items:- Combobox2 drop down menu have 3items
    2. Test1 Left
    3. Test2 Right
    4. Test3 Bottom
    5. Test4
    To copy to clipboard, switch view to plain text mode 

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Qcombobox

    use a QHash to store the informations.
    E.g.:
    Qt Code:
    1. QHash<int,int> state;
    2. state[0] = 1;
    To copy to clipboard, switch view to plain text mode 
    0 = index 0 of combo box 1
    1 = index of combo box 2
    and so on.

  3. The following user says thank you to Lykurg for this useful post:

    Project25 (16th December 2009)

  4. #3
    Join Date
    Mar 2007
    Posts
    15
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qcombobox

    thanks lykurg. Just found QHash or QMap

Similar Threads

  1. QItemDelegate, QDataWidgetMapper and QComboBox
    By cydside in forum Qt Programming
    Replies: 7
    Last Post: 8th April 2009, 19:44
  2. QDataWidgetMapper and QCombobox
    By miraks in forum Qt Programming
    Replies: 4
    Last Post: 6th December 2008, 18:53
  3. QComboBox drop list button events
    By maird in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2007, 20:25
  4. using QComboBox as an ItemView
    By EricTheFruitbat in forum Qt Programming
    Replies: 3
    Last Post: 24th January 2007, 17:14
  5. QDataWidgetMapper <=> QComboBox best practice
    By saknopper in forum Qt Programming
    Replies: 1
    Last Post: 18th January 2007, 11:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.