solved:

if interesting

Qt Code:
  1. void EventDialog::popUpIndex(QModelIndex s)
  2. {
  3. QCompleter * cl = qobject_cast<QCompleter * >(sender());
  4. QComboBox * cb = qobject_cast<QComboBox * >(sender()->parent());
  5.  
  6. int completer_id=cl->completionModel()->data(cl->completionModel()->index(s.row(),0)).toInt();
  7.  
  8. QModelIndexList indexList = cb->model()->match(cb->model()->index(0,0), Qt::DisplayRole, completer_id, 1, Qt::MatchExactly);
  9. if(indexList.count())
  10. {
  11. QModelIndex index=indexList.first();
  12. cb->setCurrentIndex(index.row());
  13. }
  14. }
To copy to clipboard, switch view to plain text mode