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