Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
routehandler.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4//! [RouteHandler]
5class RouteHandler : public QObject
6{
8public:
12
14
15 // The request defaults to the fastest route by car, which is
16 // equivalent to:
17 // request.setTravelMode(QGeoRouteRequest::CarTravel);
18 // request.setRouteOptimization(QGeoRouteRequest::FastestRoute);
19
22
24
26 // ... inform the user that the routing manager does not
27 // provide support for avoiding tolls and/or motor pool lanes ...
28 return;
29 }
30
32
33 if (reply->isFinished()) {
34 if (reply->error() == QGeoRouteReply::NoError) {
36 } else {
38 }
39 return;
40 }
41
44
46 this, &RouteHandler::routeError);
47 }
48
49private slots:
51 {
52 // A route request can ask for several alternative routes ...
53 if (reply->routes().size() != 0) {
54
55 // ... but by default it will only get a single route
57
58 //... now we have to make use of the route ...
59 }
60
62 }
63
65 {
66 // ... inform the user that an error has occurred ...
68 }
69};
70//! [RouteHandler]
[RouteHandler]
Definition routehandler.h:6