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
qgeocodereply.cpp
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#include "qgeocodereply.h"
5#include "qgeocodereply_p.h"
6
7#include <QtCore/QVariant>
8#include <QtPositioning/QGeoLocation>
9
67 : QObject(parent),
68 d_ptr(new QGeoCodeReplyPrivate()) {}
69
74 : QObject(parent),
75 d_ptr(new QGeoCodeReplyPrivate(error, errorString))
76{}
77
82{
83 delete d_ptr;
84}
85
96void QGeoCodeReply::setFinished(bool finished)
97{
98 d_ptr->isFinished = finished;
99 if (d_ptr->isFinished)
100 emit this->finished();
101}
102
108{
109 return d_ptr->isFinished;
110}
111
120{
121 d_ptr->error = error;
122 d_ptr->errorString = errorString;
123 emit this->errorOccurred(error, errorString);
124 setFinished(true);
125}
126
133{
134 return d_ptr->error;
135}
136
148{
149 return d_ptr->errorString;
150}
151
156{
157 d_ptr->viewport = viewport;
158}
159
167{
168 return d_ptr->viewport;
169}
170
177QList<QGeoLocation> QGeoCodeReply::locations() const
178{
179 return d_ptr->locations;
180}
181
189
193void QGeoCodeReply::setLocations(const QList<QGeoLocation> &locations)
194{
195 d_ptr->locations = locations;
196}
197
215{
216 if (!isFinished())
217 setFinished(true);
218 emit aborted();
219}
220
230{
231 return d_ptr->limit;
232}
233
239{
240 return d_ptr->offset;
241}
242
249{
250 d_ptr->limit = limit;
251}
252
261
291/*******************************************************************************
292*******************************************************************************/
293
295
297 : error(error), errorString(errorString), isFinished(true)
298{}
299
304
309
QGeoCodeReply::Error error
static const QGeoCodeReplyPrivate * get(const QGeoCodeReply &reply)
QList< QGeoLocation > locations
\inmodule QtLocation
void finished()
This signal is emitted when this reply has finished processing.
void errorOccurred(QGeoCodeReply::Error error, const QString &errorString=QString())
This signal is emitted when an error has been detected in the processing of this reply.
qsizetype limit() const
Returns the limit on the number of responses from each data source.
qsizetype offset() const
Returns the offset into the entire result set at which to start fetching results.
void setLimit(qsizetype limit)
Sets the limit on the number of responses from each data source to limit.
QGeoShape viewport() const
Returns the viewport which contains the results.
virtual ~QGeoCodeReply()
Destroys this reply object.
bool isFinished() const
Return true if the operation completed successfully or encountered an error which cause the operation...
Error
Describes an error which prevented the completion of the operation.
void setViewport(const QGeoShape &viewport)
Sets the viewport which contains the results to viewport.
Error error() const
Returns the error state of this reply.
void addLocation(const QGeoLocation &location)
Adds location to the list of locations in this reply.
void setFinished(bool finished)
Sets whether or not this reply has finished to finished.
virtual void abort()
Cancels the operation immediately.
void setError(Error error, const QString &errorString)
Sets the error state of this reply to error and the textual representation of the error to errorStrin...
QList< QGeoLocation > locations() const
Returns a list of locations.
void setLocations(const QList< QGeoLocation > &locations)
Sets the list of locations in the reply.
QGeoCodeReply(Error error, const QString &errorString, QObject *parent=nullptr)
Constructs a geocode reply with a given error and errorString and the specified parent.
void setOffset(qsizetype offset)
Sets the offset in the entire result set at which to start fetching result to offset.
QString errorString() const
Returns the textual representation of the error state of this reply.
\inmodule QtPositioning
\inmodule QtPositioning
Definition qgeoshape.h:17
void append(parameter_type t)
Definition qlist.h:458
\inmodule QtCore
Definition qobject.h:103
QScopedPointer< QObjectData > d_ptr
Definition qobject.h:373
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLint location
GLenum GLuint GLintptr offset
GLint limit
GLuint const GLint * locations
#define emit
ptrdiff_t qsizetype
Definition qtypes.h:165
view viewport() -> scroll(dx, dy, deviceRect)
QNetworkReply * reply