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
qgeoroutexmlparser.h
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#ifndef QROUTEXMLPARSER_H
5#define QROUTEXMLPARSER_H
6
7#include <QtCore/QObject>
8#include <QtCore/QRunnable>
9#include <QtCore/QString>
10#include <QtCore/QList>
11
12#include <QtLocation/QGeoRouteRequest>
13#include <QtLocation/QGeoRouteSegment>
14#include <QtLocation/QGeoManeuver>
15#include <QtLocation/qgeoroute.h>
16
18
19class QXmlStreamReader;
20class QGeoRoute;
21class QGeoCoordinate;
22class QGeoRectangle;
23
25{
26public:
29 QString toLink; // Id of the link this maneuver brings into
30 int legIndex = 0;
31 int index = 0;
32 QList<QGeoCoordinate> path;
33 bool first = false;
34 bool last = false;
35};
36
38{
39public:
43
45 {
46 return ( segment == other.segment && id == other.id && maneuverId == other.maneuverId );
47 }
48};
49
51{
52public:
54
55public:
57 double baseSpeed;
60};
61
62class QGeoRouteXmlParser : public QObject, public QRunnable
63{
65
66public:
69
70 void parse(const QByteArray &data);
71 void run() override;
72
74 void results(const QList<QGeoRoute> &routes);
75 void errorOccurred(const QString &errorString);
76
77private:
78 bool parseRootElement();
79 bool parseRoute(QGeoRoute *route);
80 //bool parseWaypoint(QGeoRoute *route);
81 bool parseCoordinates(QGeoCoordinate &coord);
82 bool parseMode(QGeoRoute *route);
83 bool parseSummary(QGeoRoute *route);
84 bool parseGeoPoints(const QString &strPoints, QList<QGeoCoordinate> *geoPoints, const QString &elementName);
85 bool parseLeg(int legIndex);
86 bool parseManeuver(QList<QGeoManeuverContainer> &maneuvers);
87 bool parseLink(QList<QGeoRouteSegmentContainer> &links);
88 bool postProcessRoute(QGeoRoute *route);
89
90 bool parseBoundingBox(QGeoRectangle &bounds);
91 bool parseDynamicSpeedInfo(QGeoDynamicSpeedInfoContainer &speedInfo);
92
93 QGeoRouteRequest m_request;
94 QByteArray m_data;
95 QXmlStreamReader *m_reader;
96
97 QList<QGeoRoute> m_results;
98 QList<QGeoRoute> m_legs;
99 QList<QList<QGeoManeuverContainer>> m_maneuvers;
100 //QList<QList<QGeoRouteSegmentContainer>> m_segments;
101};
102
104
105#endif
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtPositioning
QList< QGeoCoordinate > path
\inmodule QtLocation
\inmodule QtPositioning
\inmodule QtLocation
bool operator==(const QGeoRouteSegmentContainer &other) const
\inmodule QtLocation
QGeoRouteXmlParser(const QGeoRouteRequest &request)
void parse(const QByteArray &data)
void results(const QList< QGeoRoute > &routes)
void errorOccurred(const QString &errorString)
void run() override
Implement this pure virtual function in your subclass.
\inmodule QtLocation
Definition qgeoroute.h:24
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore
Definition qrunnable.h:18
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
GLuint index
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint first
GLuint segment
GLuint coord
#define Q_OBJECT
#define signals
QSharedPointer< T > other(t)
[5]
QNetworkRequest request(url)