13QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QGeoRouteSegmentPrivate)
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
61
64
65
66
67
68
69QGeoRouteSegment::QGeoRouteSegment()
70 : d_ptr(
new QGeoRouteSegmentPrivate()) {}
73
74
75QGeoRouteSegment::QGeoRouteSegment(
const QGeoRouteSegment &other)
noexcept =
default;
78
79
80QGeoRouteSegment::QGeoRouteSegment(QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> &&dd)
84
85
86QGeoRouteSegment::~QGeoRouteSegment() =
default;
90
91
92
93QGeoRouteSegment &QGeoRouteSegment::operator=(
const QGeoRouteSegment & other)
noexcept
103
104
105
106
107
110
111
112
113
114
115
117bool QGeoRouteSegment::isEqual(
const QGeoRouteSegment &other)
const noexcept
119 return ( (d_ptr.constData() == other.d_ptr.constData())
120 || (*d_ptr) == (*other.d_ptr));
124
125
126
127
128
129bool QGeoRouteSegment::isValid()
const
131 return d_ptr->valid();
135
136
137
138
139bool QGeoRouteSegment::isLegLastSegment()
const
144 if (!d_ptr->nextRouteSegment())
146 return d_ptr->isLegLastSegment();
150
151
152void QGeoRouteSegment::setNextRouteSegment(
const QGeoRouteSegment &routeSegment)
154 d_ptr->setValid(
true);
155 d_ptr->setNextRouteSegment(routeSegment.d_ptr);
159
160
161
162
163
164QGeoRouteSegment QGeoRouteSegment::nextRouteSegment()
const
166 if (d_ptr->valid() && d_ptr->nextRouteSegment())
167 return QGeoRouteSegment(d_ptr->nextRouteSegment());
169 return QGeoRouteSegment();
173
174
175
176
177
178
181
182
183
184
185void QGeoRouteSegment::setTravelTime(
int secs)
187 d_ptr->setValid(
true);
188 d_ptr->setTravelTime(secs);
191int QGeoRouteSegment::travelTime()
const
193 return d_ptr->travelTime();
197
198
199
200
201
204
205
206
207void QGeoRouteSegment::setDistance(qreal distance)
209 d_ptr->setValid(
true);
210 d_ptr->setDistance(distance);
213qreal QGeoRouteSegment::distance()
const
215 return d_ptr->distance();
219
220
221
222
223
224
225
226
227
228
229
230
233
234
235
236
237
238
239void QGeoRouteSegment::setPath(
const QList<QGeoCoordinate> &path)
241 d_ptr->setValid(
true);
242 d_ptr->setPath(path);
245QList<QGeoCoordinate> QGeoRouteSegment::path()
const
247 return d_ptr->path();
251
252
253
254
255
256
257
260
261
262
263
264
265
266void QGeoRouteSegment::setManeuver(
const QGeoManeuver &maneuver)
268 d_ptr->setValid(
true);
269 d_ptr->setManeuver(maneuver);
272QGeoManeuver QGeoRouteSegment::maneuver()
const
274 return d_ptr->maneuver();
278
280QGeoRouteSegmentPrivate::QGeoRouteSegmentPrivate() =
default;
282bool operator==(
const QGeoRouteSegmentPrivate &lhs,
const QGeoRouteSegmentPrivate &rhs)
284 return lhs.m_valid == rhs.m_valid
285 && lhs.m_travelTime == rhs.m_travelTime
286 && lhs.m_distance == rhs.m_distance
287 && lhs.m_path == rhs.m_path
288 && lhs.m_maneuver == rhs.m_maneuver;
291bool QGeoRouteSegmentPrivate::valid()
const
296void QGeoRouteSegmentPrivate::setValid(
bool valid)
301bool QGeoRouteSegmentPrivate::isLegLastSegment()
const
303 return m_legLastSegment;
306void QGeoRouteSegmentPrivate::setLegLastSegment(
bool lastSegment)
308 m_legLastSegment = lastSegment;
311int QGeoRouteSegmentPrivate::travelTime()
const
316void QGeoRouteSegmentPrivate::setTravelTime(
int travelTime)
318 m_travelTime = travelTime;
321qreal QGeoRouteSegmentPrivate::distance()
const
326void QGeoRouteSegmentPrivate::setDistance(qreal distance)
328 m_distance = distance;
331QList<QGeoCoordinate> QGeoRouteSegmentPrivate::path()
const
336void QGeoRouteSegmentPrivate::setPath(
const QList<QGeoCoordinate> &path)
341QGeoManeuver QGeoRouteSegmentPrivate::maneuver()
const
346void QGeoRouteSegmentPrivate::setManeuver(
const QGeoManeuver &maneuver)
348 m_maneuver = maneuver;
351QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> QGeoRouteSegmentPrivate::nextRouteSegment()
const
353 return m_nextSegment;
356void QGeoRouteSegmentPrivate::setNextRouteSegment(
const QExplicitlySharedDataPointer<QGeoRouteSegmentPrivate> &next)
358 m_nextSegment = next;
361QGeoRouteSegmentPrivate *QGeoRouteSegmentPrivate::get(QGeoRouteSegment &segment)
363 return segment.d_ptr.data();
368#include "moc_qgeoroutesegment.cpp"
bool operator==(const QGeoRouteSegmentPrivate &lhs, const QGeoRouteSegmentPrivate &rhs)