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
qplacematchrequest.cpp
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
5
6#include <QtCore/QSharedData>
7#include <QtCore/QList>
8#include <QtLocation/QPlace>
9#include <QtLocation/QPlaceResult>
10
12
14{
15public:
17
18 void clear();
19
20 QList<QPlace> places;
22};
23
25
27{
28 return (places == other.places
29 && parameters == other.parameters);
30}
31
37
64
72
77
82
88{
89 if (this == &other)
90 return *this;
91 d_ptr = other.d_ptr;
92 return *this;
93}
94
107bool QPlaceMatchRequest::isEqual(const QPlaceMatchRequest &other) const noexcept
108{
109 Q_D(const QPlaceMatchRequest);
110 return *d == *other.d_func();
111}
112
113
114
118QList<QPlace> QPlaceMatchRequest::places() const
119{
120 Q_D(const QPlaceMatchRequest);
121 return d->places;
122}
123
129void QPlaceMatchRequest::setPlaces(const QList<QPlace> &places)
130{
132 d->places = places;
133}
134
141void QPlaceMatchRequest::setResults(const QList<QPlaceSearchResult> &results)
142{
144 QList<QPlace> places;
145 for (const QPlaceSearchResult &result : results) {
147 QPlaceResult placeResult = result;
148 places.append(placeResult.place());
149 }
150 }
151
152 d->places = places;
153}
154
159{
160 Q_D(const QPlaceMatchRequest);
161 return d->parameters;
162}
163
168{
170 d->parameters = parameters;
171}
172
177{
179 d->clear();
180}
181
182inline QPlaceMatchRequestPrivate *QPlaceMatchRequest::d_func()
183{
184 return static_cast<QPlaceMatchRequestPrivate *>(d_ptr.data());
185}
186
187inline const QPlaceMatchRequestPrivate *QPlaceMatchRequest::d_func() const
188{
189 return static_cast<const QPlaceMatchRequestPrivate *>(d_ptr.constData());
190}
191
void append(parameter_type t)
Definition qlist.h:458
void clear()
Definition qlist.h:434
void clear()
Definition qmap.h:289
bool operator==(const QPlaceMatchRequestPrivate &other) const
\inmodule QtLocation
QPlaceMatchRequest()
Default constructor.
void setParameters(const QVariantMap &parameters)
Sets the parameters for matching places.
~QPlaceMatchRequest()
Destroys the request object.
void clear()
Clears the match request.
QList< QPlace > places() const
Returns a list of places which are to be matched.
QVariantMap parameters() const
Returns the parameters for matching places.
QPlaceMatchRequest & operator=(const QPlaceMatchRequest &other) noexcept
Assigns other to this search request and returns a reference to this match request.
void setResults(const QList< QPlaceSearchResult > &results)
Convenience function which uses a set of search results to set the places which should be matched.
void setPlaces(const QList< QPlace > &places)
Sets a list of places which are to be matched.
static const QString AlternativeId
\variable QPlaceMatchRequest::AlternativeId The key to specify that matching is to be accomplished vi...
\inmodule QtLocation
\inmodule QtLocation
const T * constData() const noexcept
Returns a const pointer to the shared data object.
Definition qshareddata.h:51
T * data()
Returns a pointer to the shared data object.
Definition qshareddata.h:47
\inmodule QtCore
Definition qshareddata.h:19
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
GLuint64EXT * result
[6]
#define QT_DEFINE_QSDP_SPECIALIZATION_DTOR(Class)
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
QSharedPointer< T > other(t)
[5]