You can use QCompleter which provides an autocomplete method in widgets such as QLineEdit and QComboBox . When a user begins to enter a word, QCompleter offers possible ways to complete a word based on a list of words.
An example from the Qt documentation :
QStringList wordList; wordList << "alpha" << "omega" << "omicron" << "zeta"; QLineEdit *lineEdit = new QLineEdit(this); QCompleter *completer = new QCompleter(wordList, this); completer->setCaseSensitivity(Qt::CaseInsensitive); lineEdit->setCompleter(completer);
Nejat source share