Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qdeclarativesearchmodelbase_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 QDECLARATIVESEARCHMODELBASE_H
5#define QDECLARATIVESEARCHMODELBASE_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/qdeclarativegeoserviceprovider_p.h>
20#include <QtCore/QAbstractListModel>
21#include <QtQml/QQmlParserStatus>
22#include <QtLocation/QPlaceSearchRequest>
23#include <QtLocation/QPlaceSearchResult>
24#include <QtLocation/QPlaceReply>
25
27
28class QPlaceManager;
32
33class Q_LOCATION_PRIVATE_EXPORT QDeclarativeSearchModelBase : public QAbstractListModel, public QQmlParserStatus
34{
36
37 Q_PROPERTY(QDeclarativeGeoServiceProvider *plugin READ plugin WRITE setPlugin NOTIFY pluginChanged)
38 Q_PROPERTY(QVariant searchArea READ searchArea WRITE setSearchArea NOTIFY searchAreaChanged)
39 Q_PROPERTY(int limit READ limit WRITE setLimit NOTIFY limitChanged)
40 Q_PROPERTY(bool previousPagesAvailable READ previousPagesAvailable NOTIFY previousPagesAvailableChanged)
41 Q_PROPERTY(bool nextPagesAvailable READ nextPagesAvailable NOTIFY nextPagesAvailableChanged)
42 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
43
45
47
48public:
49 enum Status {
53 Error
54 };
55
56 explicit QDeclarativeSearchModelBase(QObject *parent = nullptr);
58
59 QDeclarativeGeoServiceProvider *plugin() const;
60 void setPlugin(QDeclarativeGeoServiceProvider *plugin);
61
62 QVariant searchArea() const;
63 void setSearchArea(const QVariant &searchArea);
64
65 int limit() const;
66 void setLimit(int limit);
67
68 bool previousPagesAvailable() const;
69 bool nextPagesAvailable() const;
70
71 Status status() const;
72 void setStatus(Status status, const QString &errorString = QString());
73
74 Q_INVOKABLE void update();
75
76 Q_INVOKABLE void cancel();
77 Q_INVOKABLE void reset();
78
79 Q_INVOKABLE QString errorString() const;
80
81 Q_INVOKABLE void previousPage();
82 Q_INVOKABLE void nextPage();
83
84 virtual void clearData(bool suppressSignal = false);
85
86 // From QQmlParserStatus
87 void classBegin() override;
88 void componentComplete() override;
89
97
98protected:
99 virtual void initializePlugin(QDeclarativeGeoServiceProvider *plugin);
100
101protected Q_SLOTS:
102 virtual void queryFinished() = 0;
103 virtual void onContentUpdated();
104
105private Q_SLOTS:
106 void pluginNameChanged();
107
108protected:
110 void setPreviousPageRequest(const QPlaceSearchRequest &previous);
111 void setNextPageRequest(const QPlaceSearchRequest &next);
112
115 QPlaceReply *m_reply = nullptr;
116
117private:
118 bool m_complete = false;
119 Status m_status = Null;
120 QString m_errorString;
121 QPlaceSearchRequest m_previousPageRequest;
122 QPlaceSearchRequest m_nextPageRequest;
123};
124
126
127#endif // QDECLARATIVESEARCHMODELBASE_H
virtual void queryFinished()=0
virtual QPlaceReply * sendQuery(QPlaceManager *manager, const QPlaceSearchRequest &request)=0
\inmodule QtCore
Definition qobject.h:90
\inmodule QtLocation
\inmodule QtLocation
Definition qplacereply.h:15
\inmodule QtLocation
\inmodule QtLocation
The QQmlParserStatus class provides updates on the QML parser state.
virtual void classBegin()=0
Invoked after class creation, but before any properties have been set.
virtual void componentComplete()=0
Invoked after the root component that caused this instantiation has completed construction.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qvariant.h:64
void statusChanged(QDeclarativeComponent::Status status)
[1]
Definition qlogging.cpp:9
short next
Definition keywords.cpp:445
Combined button and popup list for selecting options.
GLboolean reset
GLint limit
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE
#define Q_INTERFACES(x)
#define Q_SLOTS
#define Q_ENUMS(x)
#define Q_SIGNALS
future cancel()
QNetworkAccessManager manager
QNetworkRequest request(url)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent