Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_gui_util_qcompleter.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
6wordList << "alpha" << "omega" << "omicron" << "zeta";
7
8QLineEdit *lineEdit = new QLineEdit(this);
9
12lineEdit->setCompleter(completer);
14
15
19lineEdit->setCompleter(completer);
21
22
24for (int i = 0; completer->setCurrentRow(i); i++)
25 qDebug() << completer->currentCompletion() << " is match number " << i;
The QCompleter class provides completions based on an item model.
Definition qcompleter.h:24
bool setCurrentRow(int row)
Sets the current row to the row specified.
void setModel(QAbstractItemModel *c)
Sets the model which provides completions to model.
QString currentCompletion() const
Returns the current completion string.
void setCaseSensitivity(Qt::CaseSensitivity caseSensitivity)
The QFileSystemModel class provides a data model for the local filesystem.
The QLineEdit widget is a one-line text editor.
Definition qlineedit.h:28
\inmodule QtCore
@ CaseInsensitive
#define qDebug
[1]
Definition qlogging.h:164
QLineEdit * lineEdit
QStringList wordList
[0]
QCompleter * completer
[0]