Hi,
Assume there is a lineEdit With a completer that a stringList is added to the completer. While typing in the lineEdite, some words appear that by clicking on one of them, I need the index of that word in the stringList be returned. is there any signal for this?
for example:
wordList << "yawalpha" << "omeyawga" << "omicyaron" << "zetaYAW";
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setFilterMode(Qt::MatchContains);
lineEdit->setCompleter(completer);//for example when i type "omicyaron" in the lineEdit and click on that in the completer, it emits a signal with value of 2 (index of position of "omicyaron" in the wordList )
wdg.show();
QWidget wdg;
QStringList wordList;
wordList << "yawalpha" << "omeyawga" << "omicyaron" << "zetaYAW";
QLineEdit *lineEdit = new QLineEdit(&wdg);
QCompleter *completer = new QCompleter(wordList,&wdg);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setFilterMode(Qt::MatchContains);
lineEdit->setCompleter(completer);//for example when i type "omicyaron" in the lineEdit and click on that in the completer, it emits a signal with value of 2 (index of position of "omicyaron" in the wordList )
wdg.show();
To copy to clipboard, switch view to plain text mode
thanks for any help
Bookmarks