Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
4//! [0]
6wordList << "alpha" << "omega" << "omicron" << "zeta";
7
8QLineEdit *lineEdit = new QLineEdit(this);
9
10QCompleter *completer = new QCompleter(wordList, this);
11completer->setCaseSensitivity(Qt::CaseInsensitive);
12lineEdit->setCompleter(completer);
13//! [0]
14
15
16//! [1]
17QCompleter *completer = new QCompleter(this);
18completer->setModel(new QFileSystemModel(completer));
19lineEdit->setCompleter(completer);
20//! [1]
21
22
23//! [2]
24for (int i = 0; completer->setCurrentRow(i); i++)
25 qDebug() << completer->currentCompletion() << " is match number " << i;
26//! [2]
QCompleter * completer
[0]
QStringList wordList
[0]