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
qdeclarativesearchsuggestionmodel_p.h
Go to the documentation of this file.
1// Copyright (C) 2015 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QDECLARATIVESEARCHSUGGESTIONMODEL_P_H
5#define QDECLARATIVESEARCHSUGGESTIONMODEL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtLocation/private/qlocationglobal_p.h>
19#include <QtLocation/private/qdeclarativesearchmodelbase_p.h>
20
21#include <QtCore/QStringList>
22
24
27
29{
31 QML_NAMED_ELEMENT(PlaceSearchSuggestionModel)
33
34 Q_PROPERTY(QString searchTerm READ searchTerm WRITE setSearchTerm NOTIFY searchTermChanged)
35 Q_PROPERTY(QStringList suggestions READ suggestions NOTIFY suggestionsChanged)
36
37public:
40
41 QString searchTerm() const;
42 void setSearchTerm(const QString &searchTerm);
43
44 QStringList suggestions() const;
45
46 void clearData(bool suppressSignal = false) override;
47
48 // From QAbstractListModel
49 int rowCount(const QModelIndex &parent) const override;
50 QVariant data(const QModelIndex &index, int role) const override;
51 QHash<int, QByteArray> roleNames() const override;
52
53 enum Roles {
54 SearchSuggestionRole = Qt::UserRole
55 };
56
57protected Q_SLOTS:
58 void queryFinished() override;
59
63
64protected:
65 QPlaceReply *sendQuery(QPlaceManager *manager, const QPlaceSearchRequest &request) override;
66
67private:
68 QStringList m_suggestions;
69};
70
72
73#endif
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtLocation
\inmodule QtCore
Definition qhash.h:820
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
\inmodule QtLocation
\inmodule QtLocation
Definition qplacereply.h:15
\inmodule QtLocation
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
@ UserRole
GLuint index
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
#define explicit
QNetworkAccessManager manager
QNetworkRequest request(url)