I have a QComboBox from which I want to extract the index of a row that contains a specific row. How can I acomplish that?
Example:
QSqlQuery qsCat
("select categID,numeCateg from categ order by numeCateg");
categorie->addItem("Categorie");
while(qsCat.next()){
categId=qsCat.value("categID").toString();
numeCat=qsCat.value("numeCateg").toString();
categorie->addItem(numeCat,categId);
}
QSqlQuery qsCat("select categID,numeCateg from categ order by numeCateg");
categorie->addItem("Categorie");
while(qsCat.next()){
categId=qsCat.value("categID").toString();
numeCat=qsCat.value("numeCateg").toString();
categorie->addItem(numeCat,categId);
}
To copy to clipboard, switch view to plain text mode
For the example let's say that
categorie->addItem()
categorie->addItem()
To copy to clipboard, switch view to plain text mode
inserts multiple rows from which I have also
categorie->addItem("Administrator","2")
categorie->addItem("Administrator","2")
To copy to clipboard, switch view to plain text mode
I would like then to use categorie->setCurrentIndex(int index) where index=index where the item has "Administrator".
Thank you
Bookmarks