12QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QGeoRouteSegmentPrivate)
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
63
64
65
66
67
68QGeoRouteSegment::QGeoRouteSegment()
69 : d_ptr(
new QGeoRouteSegmentPrivate()) {}
72
73
74QGeoRouteSegment::QGeoRouteSegment(
const QGeoRouteSegment &other)
noexcept =
default;
77
78
79QGeoRouteSegment::QGeoRouteSegment(QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> &&dd)
83
84
85QGeoRouteSegment::~QGeoRouteSegment() =
default;
89
90
91
92QGeoRouteSegment &QGeoRouteSegment::operator=(
const QGeoRouteSegment & other)
noexcept
102
103
104
105
106
109
110
111
112
113
114
116bool QGeoRouteSegment::isEqual(
const QGeoRouteSegment &other)
const noexcept
118 return ( (d_ptr.constData() == other.d_ptr.constData())
119 || (*d_ptr) == (*other.d_ptr));
123
124
125
126
127
128bool QGeoRouteSegment::isValid()
const
130 return d_ptr->valid();
134
135
136
137
138bool QGeoRouteSegment::isLegLastSegment()
const
143 if (!d_ptr->nextRouteSegment())
145 return d_ptr->isLegLastSegment();
149
150
151void QGeoRouteSegment::setNextRouteSegment(
const QGeoRouteSegment &routeSegment)
153 d_ptr->setValid(
true);
154 d_ptr->setNextRouteSegment(routeSegment.d_ptr);
158
159
160
161
162
163QGeoRouteSegment QGeoRouteSegment::nextRouteSegment()
const
165 if (d_ptr->valid() && d_ptr->nextRouteSegment())
166 return QGeoRouteSegment(d_ptr->nextRouteSegment());
168 return QGeoRouteSegment();
172
173
174
175
176
177
180
181
182
183
184void QGeoRouteSegment::setTravelTime(
int secs)
186 d_ptr->setValid(
true);
187 d_ptr->setTravelTime(secs);
190int QGeoRouteSegment::travelTime()
const
192 return d_ptr->travelTime();
196
197
198
199
200
203
204
205
206void QGeoRouteSegment::setDistance(qreal distance)
208 d_ptr->setValid(
true);
209 d_ptr->setDistance(distance);
212qreal QGeoRouteSegment::distance()
const
214 return d_ptr->distance();
218
219
220
221
222
223
224
225
226
227
228
229
232
233
234
235
236
237
238void QGeoRouteSegment::setPath(
const QList<QGeoCoordinate> &path)
240 d_ptr->setValid(
true);
241 d_ptr->setPath(path);
244QList<QGeoCoordinate> QGeoRouteSegment::path()
const
246 return d_ptr->path();
250
251
252
253
254
255
256
259
260
261
262
263
264
265void QGeoRouteSegment::setManeuver(
const QGeoManeuver &maneuver)
267 d_ptr->setValid(
true);
268 d_ptr->setManeuver(maneuver);
271QGeoManeuver QGeoRouteSegment::maneuver()
const
273 return d_ptr->maneuver();
277
279QGeoRouteSegmentPrivate::QGeoRouteSegmentPrivate() =
default;
281bool operator==(
const QGeoRouteSegmentPrivate &lhs,
const QGeoRouteSegmentPrivate &rhs)
283 return lhs.m_valid == rhs.m_valid
284 && lhs.m_travelTime == rhs.m_travelTime
285 && lhs.m_distance == rhs.m_distance
286 && lhs.m_path == rhs.m_path
287 && lhs.m_maneuver == rhs.m_maneuver;
290bool QGeoRouteSegmentPrivate::valid()
const
295void QGeoRouteSegmentPrivate::setValid(
bool valid)
300bool QGeoRouteSegmentPrivate::isLegLastSegment()
const
302 return m_legLastSegment;
305void QGeoRouteSegmentPrivate::setLegLastSegment(
bool lastSegment)
307 m_legLastSegment = lastSegment;
310int QGeoRouteSegmentPrivate::travelTime()
const
315void QGeoRouteSegmentPrivate::setTravelTime(
int travelTime)
317 m_travelTime = travelTime;
320qreal QGeoRouteSegmentPrivate::distance()
const
325void QGeoRouteSegmentPrivate::setDistance(qreal distance)
327 m_distance = distance;
330QList<QGeoCoordinate> QGeoRouteSegmentPrivate::path()
const
335void QGeoRouteSegmentPrivate::setPath(
const QList<QGeoCoordinate> &path)
340QGeoManeuver QGeoRouteSegmentPrivate::maneuver()
const
345void QGeoRouteSegmentPrivate::setManeuver(
const QGeoManeuver &maneuver)
347 m_maneuver = maneuver;
350QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> QGeoRouteSegmentPrivate::nextRouteSegment()
const
352 return m_nextSegment;
355void QGeoRouteSegmentPrivate::setNextRouteSegment(
const QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> &next)
357 m_nextSegment = next;
360QGeoRouteSegmentPrivate *QGeoRouteSegmentPrivate::get(QGeoRouteSegment &segment)
362 return segment.d_ptr.data();
367#include "moc_qgeoroutesegment.cpp"
bool operator==(const QGeoRouteSegmentPrivate &lhs, const QGeoRouteSegmentPrivate &rhs)