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:
Qt Code:
  1. QSqlQuery qsCat("select categID,numeCateg from categ order by numeCateg");
  2. categorie->addItem("Categorie");
  3. while(qsCat.next()){
  4. categId=qsCat.value("categID").toString();
  5. numeCat=qsCat.value("numeCateg").toString();
  6. categorie->addItem(numeCat,categId);
  7. }
To copy to clipboard, switch view to plain text mode 

For the example let's say that
Qt Code:
  1. categorie->addItem()
To copy to clipboard, switch view to plain text mode 
inserts multiple rows from which I have also
Qt Code:
  1. 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