PDA

View Full Version : dropdown list in qt



vinayaka
24th February 2012, 06:50
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 ?

mentalmushroom
24th February 2012, 09:05
QComboBox *comboBox = new QComboBox;
comboBox->addItem(tr("item 1"));
comboBox->addItem(tr("item 2"));
comboBox->addItem(tr("item 3"));

QComboBox *iconComboBox = new QComboBox;
iconComboBox->addItem(QIcon(":/images/bad.svg"), tr("Bad"));
iconComboBox->addItem(QIcon(":/images/heart.svg"), tr("Heart"));
iconComboBox->addItem(QIcon(":/images/trash.svg"), tr("Trash"));