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
qgeoroutereply.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
4#include "qgeoroutereply.h"
5#include "qgeoroutereply_p.h"
6
8
67
72 : QObject(parent),
73 d_ptr(new QGeoRouteReplyPrivate(error, errorString)) {}
74
79{
80 delete d_ptr;
81}
82
93void QGeoRouteReply::setFinished(bool finished)
94{
95 d_ptr->isFinished = finished;
96 if (d_ptr->isFinished)
97 emit this->finished();
98}
99
105{
106 return d_ptr->isFinished;
107}
108
117{
118 d_ptr->error = error;
119 d_ptr->errorString = errorString;
121 setFinished(true);
122}
123
130{
131 return d_ptr->error;
132}
133
145{
146 return d_ptr->errorString;
147}
148
153{
154 return d_ptr->request;
155}
156
160QList<QGeoRoute> QGeoRouteReply::routes() const
161{
162 return d_ptr->routes;
163}
164
168void QGeoRouteReply::setRoutes(const QList<QGeoRoute> &routes)
169{
170 d_ptr->routes = routes;
171}
172
176void QGeoRouteReply::addRoutes(const QList<QGeoRoute> &routes)
177{
178 d_ptr->routes.append(routes);
179}
180
196{
197 emit aborted();
198}
199
229/*******************************************************************************
230*******************************************************************************/
231
235
237 : error(error),
238 errorString(errorString),
239 isFinished(true)
240{}
241
QGeoRouteReply::Error error
QList< QGeoRoute > routes
QGeoRouteRequest request
QGeoRouteReplyPrivate(const QGeoRouteRequest &request)
void finished()
This signal is emitted when this reply has finished processing.
QGeoRouteReply(Error error, const QString &errorString, QObject *parent=nullptr)
Constructs a route reply with a given error and errorString and the specified parent.
QList< QGeoRoute > routes() const
Returns the list of routes which were requested.
Error error() const
Returns the error state of this reply.
void addRoutes(const QList< QGeoRoute > &routes)
Appends the list of routes to the existing list.
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...
void setRoutes(const QList< QGeoRoute > &routes)
Sets the list of routes in the reply to routes.
QGeoRouteRequest request() const
Returns the route request which specified the route.
QString errorString() const
Returns the textual representation of the error state of this reply.
virtual void abort()
Cancels the operation immediately.
Error
Describes an error which prevented the completion of the operation.
virtual ~QGeoRouteReply()
Destroys this route reply object.
bool isFinished() const
Return true if the operation completed successfully or encountered an error which cause the operation...
void errorOccurred(QGeoRouteReply::Error error, const QString &errorString=QString())
This signal is emitted when an error has been detected in the processing of this reply.
void setFinished(bool finished)
Sets whether or not this reply has finished to finished.
\inmodule QtLocation
void append(parameter_type t)
Definition qlist.h:458
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
#define emit
QNetworkRequest request(url)