QCompleter::currentIndex returns QModelIndex of QCompleter::compleitionModel. Would it be possible to map this index to QCompleter::model so that I could access other data associated with the completion string?
Thanks a lot in advance!
QCompleter::currentIndex returns QModelIndex of QCompleter::compleitionModel. Would it be possible to map this index to QCompleter::model so that I could access other data associated with the completion string?
Thanks a lot in advance!
I found that the code below works fine and gets the right index:
Qt Code:
QAbstractProxyModel* proxyModel = qobject_cast<QAbstractProxyModel*>(m_completer->completionModel()); Q_ASSERT(proxyModel != 0); To copy to clipboard, switch view to plain text mode
But I haven't seen any documentation saying that QCompleter::completerModel is actually QAbstractProxyModel (naturally it should be). Is there a documented way to map indexes between these two models?
Bookmarks