Yes I had been trying something like that. Fortunately currentCompletion() returns the correct string else I wouldn't have a clue at all. This works:
void PlaceDialog
::edited(QString s
) {
QModelIndexList matches = model->match(model->index(0, 0), Qt::DisplayRole, completer->currentCompletion());
{
table->setCurrentIndex(model->index(index.row(), 0));
break;
}
}
void PlaceDialog::edited(QString s)
{
QModelIndexList matches = model->match(model->index(0, 0), Qt::DisplayRole, completer->currentCompletion());
foreach(const QModelIndex &index, matches)
{
table->setCurrentIndex(model->index(index.row(), 0));
break;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks