Take a look at QCompleter .
The QCompleter class provides shutdown based on the item model.
You can use QCompleter to provide automatic completion in any Qt widgets such as QLineEdit and QComboBox. When a user begins to enter a word, QCompleter offers possible ways to populate a word based on a list of words. A list of words is provided as a QAbstractItemModel. (For simple applications where the word list is static, you can pass a QStringList to the QCompleter constructor.)
source
share