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
qgeoroutingmanager.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
7
8#include <QLocale>
9
11
54QGeoRoutingManager::QGeoRoutingManager(QGeoRoutingManagerEngine *engine, QObject *parent)
55 : QObject(parent),
56 d_ptr(new QGeoRoutingManagerPrivate())
57{
58 d_ptr->engine.reset(engine);
59 if (d_ptr->engine) {
60 d_ptr->engine->setParent(this);
61
62 connect(d_ptr->engine.get(), &QGeoRoutingManagerEngine::finished,
64
67 } else {
68 qFatal("The routing manager engine that was set for this routing manager was NULL.");
69 }
70}
71
76{
77 delete d_ptr;
78}
79
88{
89 return d_ptr->engine->managerName();
90}
91
100{
101 return d_ptr->engine->managerVersion();
102}
103
126{
127 return d_ptr->engine->calculateRoute(request);
128}
129
158{
159 return d_ptr->engine->updateRoute(route, position);
160}
161
165QGeoRouteRequest::TravelModes QGeoRoutingManager::supportedTravelModes() const
166{
167 return d_ptr->engine->supportedTravelModes();
168}
169
174QGeoRouteRequest::FeatureTypes QGeoRoutingManager::supportedFeatureTypes() const
175{
176 return d_ptr->engine->supportedFeatureTypes();
177}
178
183QGeoRouteRequest::FeatureWeights QGeoRoutingManager::supportedFeatureWeights() const
184{
185 return d_ptr->engine->supportedFeatureWeights();
186}
187
191QGeoRouteRequest::RouteOptimizations QGeoRoutingManager::supportedRouteOptimizations() const
192{
193 return d_ptr->engine->supportedRouteOptimizations();
194}
195
200QGeoRouteRequest::SegmentDetails QGeoRoutingManager::supportedSegmentDetails() const
201{
202 return d_ptr->engine->supportedSegmentDetails();
203}
204
209QGeoRouteRequest::ManeuverDetails QGeoRoutingManager::supportedManeuverDetails() const
210{
211 return d_ptr->engine->supportedManeuverDetails();
212}
213
223{
224 d_ptr->engine->setLocale(locale);
225}
226
232{
233 return d_ptr->engine->locale();
234}
235
245{
246 d_ptr->engine->setMeasurementSystem(system);
247}
248
259{
260 return d_ptr->engine->measurementSystem();
261}
262
292/*******************************************************************************
293*******************************************************************************/
294
\inmodule QtPositioning
\inmodule QtLocation
\inmodule QtLocation
\inmodule QtLocation
Definition qgeoroute.h:24
void errorOccurred(QGeoRouteReply *reply, QGeoRouteReply::Error error, const QString &errorString=QString())
This signal is emitted when an error has been detected in the processing of reply.
void finished(QGeoRouteReply *reply)
This signal is emitted when reply has finished processing.
std::unique_ptr< QGeoRoutingManagerEngine > engine
QGeoRouteRequest::FeatureWeights supportedFeatureWeights() const
Returns the weightings which this manager can apply to different features during route planning.
QGeoRouteRequest::FeatureTypes supportedFeatureTypes() const
Returns the types of features that this manager can take into account during route planning.
QGeoRouteRequest::RouteOptimizations supportedRouteOptimizations() const
Returns the route optimizations supported by this manager.
QGeoRouteRequest::TravelModes supportedTravelModes() const
Returns the travel modes supported by this manager.
void setLocale(const QLocale &locale)
Sets the locale to be used by this manager to locale.
int managerVersion() const
Returns the version of the engine which implements the behaviour of this routin manager.
QLocale locale() const
Returns the locale used to hint to this routing manager about what language to use for addresses and ...
~QGeoRoutingManager()
Destroys this manager.
void finished(QGeoRouteReply *reply)
This signal is emitted when reply has finished processing.
QString managerName() const
Returns the name of the engine which implements the behaviour of this routing manager.
QGeoRouteReply * updateRoute(const QGeoRoute &route, const QGeoCoordinate &position)
Begins the process of updating route based on the current position position.
void errorOccurred(QGeoRouteReply *reply, QGeoRouteReply::Error error, const QString &errorString=QString())
This signal is emitted when an error has been detected in the processing of reply.
QGeoRouteRequest::SegmentDetails supportedSegmentDetails() const
Returns the levels of detail for routing segments which can be requested with this manager.
QLocale::MeasurementSystem measurementSystem() const
Returns the measurement system used by this manager.
QGeoRouteReply * calculateRoute(const QGeoRouteRequest &request)
Begins the calculation of the route specified by request.
QGeoRouteRequest::ManeuverDetails supportedManeuverDetails() const
Returns the levels of detail for navigation maneuvers which can be requested by this manager.
void setMeasurementSystem(QLocale::MeasurementSystem system)
Sets the measurement system used by this manager to system.
MeasurementSystem
Definition qlocale.h:867
\inmodule QtCore
Definition qobject.h:103
void setParent(QObject *parent)
Makes the object a child of parent.
Definition qobject.cpp:2195
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
#define qFatal
Definition qlogging.h:168
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
QNetworkRequest request(url)
QJSEngine engine
[0]