Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
17
QT_BEGIN_NAMESPACE
18
19
class
QXmlStreamReader;
20
class
QGeoRoute;
21
class
QGeoCoordinate;
22
class
QGeoRectangle;
23
24
class
QGeoManeuverContainer
25
{
26
public
:
27
QGeoManeuver
maneuver
;
28
QString
id
;
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
37
class
QGeoRouteSegmentContainer
38
{
39
public
:
40
QGeoRouteSegment
segment
;
41
QString
id
;
42
QString
maneuverId
;
43
44
bool
operator
==(
const
QGeoRouteSegmentContainer
&other)
const
45
{
46
return
( segment == other.segment && id == other.id && maneuverId == other.maneuverId );
47
}
48
};
49
50
class
QGeoDynamicSpeedInfoContainer
51
{
52
public
:
53
QGeoDynamicSpeedInfoContainer
();
54
55
public
:
56
double
trafficSpeed
;
57
double
baseSpeed
;
58
int
trafficTime
;
59
int
baseTime
;
60
};
61
62
class
QGeoRouteXmlParser
:
public
QObject
,
public
QRunnable
63
{
64
Q_OBJECT
65
66
public
:
67
QGeoRouteXmlParser
(
const
QGeoRouteRequest
&
request
);
68
~
QGeoRouteXmlParser
();
69
70
void
parse
(
const
QByteArray &data);
71
void
run
()
override
;
72
73
signals
:
74
void
results
(
const
QList
<
QGeoRoute
> &
routes
);
75
void
errorOccurred
(
const
QString &errorString);
76
77
private
:
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
103
QT_END_NAMESPACE
104
105
#
endif
QGeoDynamicSpeedInfoContainer
Definition
qgeoroutexmlparser.h:51
QGeoDynamicSpeedInfoContainer::baseTime
int baseTime
Definition
qgeoroutexmlparser.h:59
QGeoDynamicSpeedInfoContainer::trafficTime
int trafficTime
Definition
qgeoroutexmlparser.h:58
QGeoDynamicSpeedInfoContainer::QGeoDynamicSpeedInfoContainer
QGeoDynamicSpeedInfoContainer()
Definition
qgeoroutexmlparser.cpp:19
QGeoDynamicSpeedInfoContainer::baseSpeed
double baseSpeed
Definition
qgeoroutexmlparser.h:57
QGeoDynamicSpeedInfoContainer::trafficSpeed
double trafficSpeed
Definition
qgeoroutexmlparser.h:56
QGeoManeuverContainer
Definition
qgeoroutexmlparser.h:25
QGeoManeuverContainer::legIndex
int legIndex
Definition
qgeoroutexmlparser.h:30
QGeoManeuverContainer::last
bool last
Definition
qgeoroutexmlparser.h:34
QGeoManeuverContainer::maneuver
QGeoManeuver maneuver
Definition
qgeoroutexmlparser.h:27
QGeoManeuverContainer::index
int index
Definition
qgeoroutexmlparser.h:31
QGeoManeuverContainer::id
QString id
Definition
qgeoroutexmlparser.h:28
QGeoManeuverContainer::first
bool first
Definition
qgeoroutexmlparser.h:33
QGeoManeuverContainer::toLink
QString toLink
Definition
qgeoroutexmlparser.h:29
QGeoManeuverContainer::path
QList< QGeoCoordinate > path
Definition
qgeoroutexmlparser.h:32
QGeoRouteReplyNokia
Definition
qgeoroutereply_nokia.h:15
QGeoRouteReplyNokia::~QGeoRouteReplyNokia
~QGeoRouteReplyNokia()
Definition
qgeoroutereply_nokia.cpp:42
QGeoRouteSegmentContainer
Definition
qgeoroutexmlparser.h:38
QGeoRouteSegmentContainer::segment
QGeoRouteSegment segment
Definition
qgeoroutexmlparser.h:40
QGeoRouteSegmentContainer::operator==
bool operator==(const QGeoRouteSegmentContainer &other) const
Definition
qgeoroutexmlparser.h:44
QGeoRouteSegmentContainer::id
QString id
Definition
qgeoroutexmlparser.h:41
QGeoRouteSegmentContainer::maneuverId
QString maneuverId
Definition
qgeoroutexmlparser.h:42
QGeoRouteXmlParser
Definition
qgeoroutexmlparser.h:63
QGeoRouteXmlParser::parse
void parse(const QByteArray &data)
Definition
qgeoroutexmlparser.cpp:35
QGeoRouteXmlParser::errorOccurred
void errorOccurred(const QString &errorString)
QGeoRouteXmlParser::run
void run() override
Implement this pure virtual function in your subclass.
Definition
qgeoroutexmlparser.cpp:45
QGeoRouteXmlParser::~QGeoRouteXmlParser
~QGeoRouteXmlParser()
Definition
qgeoroutexmlparser.cpp:31
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtlocation
src
plugins
geoservices
nokia
qgeoroutexmlparser.h
Generated on
for Qt by
1.18.0