Results 1 to 2 of 2

Thread: dropdown list in qt

  1. #1
    Join Date
    May 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default dropdown list in qt

    hai all,


    how can i create a dropdown list in qt, is it possible to use Qcombobox. if it is possible please give us some guide ?

  2. #2
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: dropdown list in qt

    Qt Code:
    1. QComboBox *comboBox = new QComboBox;
    2. comboBox->addItem(tr("item 1"));
    3. comboBox->addItem(tr("item 2"));
    4. comboBox->addItem(tr("item 3"));
    5.  
    6. QComboBox *iconComboBox = new QComboBox;
    7. iconComboBox->addItem(QIcon(":/images/bad.svg"), tr("Bad"));
    8. iconComboBox->addItem(QIcon(":/images/heart.svg"), tr("Heart"));
    9. iconComboBox->addItem(QIcon(":/images/trash.svg"), tr("Trash"));
    To copy to clipboard, switch view to plain text mode 

  3. The following 2 users say thank you to mentalmushroom for this useful post:

    TheIndependentAquarius (5th January 2013), vinayaka (24th February 2012)

Similar Threads

  1. Replies: 0
    Last Post: 25th July 2011, 14:11
  2. Add a dropdown menu to QListWidgetItem
    By plan_rich in forum Newbie
    Replies: 2
    Last Post: 7th September 2010, 16:17
  3. QComboBox dropdown Height
    By minsoub in forum Qt Programming
    Replies: 2
    Last Post: 23rd February 2010, 08:02
  4. Dropdown menu?
    By rakkar in forum Newbie
    Replies: 1
    Last Post: 9th September 2009, 17:13
  5. DropDown combo box
    By Tavit in forum Qt Programming
    Replies: 3
    Last Post: 3rd May 2008, 08:40

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.