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
qgeomaneuver.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 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#include "qgeomaneuver.h"
5#include "qgeomaneuver_p.h"
6
7#include <QtCore/QVariant>
8#include "qgeocoordinate.h"
9
11
13
14
117
121QGeoManeuver::QGeoManeuver(const QGeoManeuver &other) noexcept = default;
122
127
133{
134 if (this == &other)
135 return *this;
136
137 d_ptr = other.d_ptr;
138 return *this;
139}
140
153bool QGeoManeuver::isEqual(const QGeoManeuver &other) const
154{
155 return ( (d_ptr.constData() == other.d_ptr.constData())
156 || (d_ptr->equals(*other.d_ptr)) );
157}
158
176{
177 return d_ptr->valid();
178}
179
192{
193 d_ptr->setValid(true);
194 d_ptr->setPosition(position);
195}
196
198{
199 return d_ptr->position();
200}
201
213{
214 d_ptr->setValid(true);
215 d_ptr->setText(instructionText);
216}
217
219{
220 return d_ptr->text();
221}
222
254
259
275{
276 d_ptr->setValid(true);
277 d_ptr->setTimeToNextInstruction(secs);
278}
279
281{
282 return d_ptr->timeToNextInstruction();
283}
284
303
308
324{
325 d_ptr->setValid(true);
326 d_ptr->setWaypoint(coordinate);
327}
328
330{
331 return d_ptr->waypoint();
332}
333
356{
357 d_ptr->setValid(true);
359}
360
365
366/*******************************************************************************
367*******************************************************************************/
368
370{
371 return ((valid() == other.valid())
372 && (position() == other.position())
373 && (text() == other.text())
374 && (direction() == other.direction())
375 && (timeToNextInstruction() == other.timeToNextInstruction())
376 && (distanceToNextInstruction() == other.distanceToNextInstruction())
377 && (waypoint() == other.waypoint()));
378}
379
380/*******************************************************************************
381*******************************************************************************/
382
384{
385 return m_valid;
386}
387
389{
390 m_valid = valid;
391}
392
394{
395 return m_id;
396}
397
399{
400 m_id = id;
401}
402
407
412
414{
415 return m_text;
416}
417
422
427
432
437
442
447
452
457
462
467
472
474
475#include "moc_qgeomaneuver.cpp"
\inmodule QtPositioning
QGeoCoordinate position() const
bool equals(const QGeoManeuverPrivate &other) const
qreal distanceToNextInstruction() const
QGeoCoordinate m_waypoint
QVariantMap m_extendedAttributes
QGeoCoordinate waypoint() const
QString text() const
QGeoManeuver::InstructionDirection m_direction
void setPosition(const QGeoCoordinate &position)
void setTimeToNextInstruction(int timeToNextInstruction)
QGeoManeuver::InstructionDirection direction() const
void setId(const QString &id)
void setText(const QString &text)
void setValid(bool valid)
void setDirection(QGeoManeuver::InstructionDirection direction)
QString id() const
int timeToNextInstruction() const
QVariantMap extendedAttributes() const
void setDistanceToNextInstruction(qreal distanceToNextInstruction)
void setExtendedAttributes(const QVariantMap &extendedAttributes)
QGeoCoordinate m_position
void setWaypoint(const QGeoCoordinate &waypoint)
\inmodule QtLocation
void setWaypoint(const QGeoCoordinate &coordinate)
void setInstructionText(const QString &instructionText)
QVariantMap extendedAttributes
\qmlproperty Object routeManeuver::extendedAttributes
QGeoManeuver()
Constructs a invalid maneuver object.
InstructionDirection direction
\qmlproperty enumeration routeManeuver::direction
QGeoCoordinate position
\qmlproperty coordinate routeManeuver::position
qreal distanceToNextInstruction
\qmlproperty real routeManeuver::distanceToNextInstruction
QString instructionText
\qmlproperty string routeManeuver::instructionText
QGeoManeuver & operator=(const QGeoManeuver &other)
Assigns other to this maneuver object and then returns a reference to this maneuver object.
void setTimeToNextInstruction(int secs)
~QGeoManeuver()
Destroys this maneuver object.
void setDirection(InstructionDirection direction)
void setDistanceToNextInstruction(qreal distance)
QGeoCoordinate waypoint
\qmlproperty coordinate routeManeuver::waypoint
void setPosition(const QGeoCoordinate &position)
bool isValid() const
InstructionDirection
\qmltype routeManeuver \inqmlmodule QtLocation
int timeToNextInstruction
\qmlproperty int routeManeuver::timeToNextInstruction
void setExtendedAttributes(const QVariantMap &extendedAttributes)
const T * constData() const noexcept
Returns a const pointer to the shared data object.
Definition qshareddata.h:51
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString text
direction
Combined button and popup list for selecting options.
static QString instructionText(const QJsonObject &step, const QJsonObject &maneuver, QGeoManeuver::InstructionDirection direction)
GLsizei GLsizei GLfloat distance
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define QT_DEFINE_QSDP_SPECIALIZATION_DTOR(Class)
double qreal
Definition qtypes.h:187
QSharedPointer< T > other(t)
[5]