Questions tagged [qcompleter]

A QCompleter is a class from the Qt toolkit which provides completions based on an item model.

QCompleter can be set to provide auto-completion for any widget.

A simple example of using the QCompleter will look like this:

//this will contain the words for autocompletion.
QStringList words;
//Let's populate it:
words << "hello" << "word" << "this" << "is" << "qt" << "auto-completer";
//We will be using auto-completer for a QLineEdit
QLineEdit * l = new QLineEdit();
//Creating the QCompleter, and giving it the word list
QCompleter * completer = new QCompleter( words );
//Setting the case sensivity
completer->setCaseSensitivity( Qt::CaseInsensitive );
//Assigning the completer to the LineEdit
l->setCompleter( completer );
//And finally showing the edit.
l->show();

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

122 questions
0
votes
1 answer

Custom QCompleter strange behavior

I all, I just follow this great example: http://qt-project.org/doc/qt-4.8/tools-customcompleter.html I copy the code exactly except some change with the modelFromFile method, here is it: QAbstractItemModel *MainWindow::modelFromFile(const QString&…
nvcnvn
  • 4,991
  • 8
  • 49
  • 77
-1
votes
1 answer

Google search suggestion in PyQt5

I built a google search suggestion completer for my simple browser built with pyqt5 and python. code is below. self.url_bar = QLineEdit() self.url_bar.textChanged.connect(self.suggest) def suggest(self): suggestlist =[] term…
1 2 3
8
9