Hi , i am newbie here
i added new comboBox to my gui like that
list
->setObjectName
(QString::fromUtf8("list"));
list
->setGeometry
(QRect(0,
40,
69,
22));
list->setModel(model);
QComboBox *list;
list=new QComboBox(dockWidgetContents_8);
list->setObjectName(QString::fromUtf8("list"));
list->setGeometry(QRect(0, 40, 69, 22));
list->setModel(model);
To copy to clipboard, switch view to plain text mode
where i created my model and i add to my list like that
void MainWindow::createModel()
{
model
->setHorizontalHeaderLabels
( QStringList() <<
"liste" );
}
void MainWindow::createModelItems()
{
model->appendRow( pItem );
}
{
model->appendRow( pItem );
}
void MainWindow::createModel()
{
model = new QStandardItemModel( 0,0,this );
model->setHorizontalHeaderLabels( QStringList() << "liste" );
}
void MainWindow::createModelItems()
{
QStringList choiceList, optionList;
QStandardItem *pItem;
model->appendRow( pItem );
}
void MainWindow::itemAded( QStandardItem *pItem )
{
model->appendRow( pItem );
}
To copy to clipboard, switch view to plain text mode
i have no problem with that, i can add easy in my combobox
the problem that now i want when i select (or clic ) on item i send the information of this item (its index or it's name) to another function , i have no problem with the slot , my problem is in the signal how i recuperate the index of the ittem selected
Bookmarks