Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autocomplete textbox in qt?

Tags:

qt

qt4

I am new to QT, how to implement autocomplete textbox in qt or is there already solution for that ? I have vector of words. Can somebody give me advice how to do this ?

like image 355
Damir Avatar asked Aug 12 '11 15:08

Damir


1 Answers

Take a look at QCompleter.

The QCompleter class provides completions based on an item model.

You can use QCompleter to provide auto completions in any Qt widget, such as QLineEdit and QComboBox. When the user starts typing a word, QCompleter suggests possible ways of completing the word, based on a word list. The word list is provided as a QAbstractItemModel. (For simple applications, where the word list is static, you can pass a QStringList to QCompleter's constructor.)

like image 96
utdemir Avatar answered Sep 27 '22 18:09

utdemir