QGeoManeuver Class

The QGeoManeuver class represents the information relevant to the point at which two QGeoRouteSegments meet. More...

Header: #include <QGeoManeuver>
qmake: QT += location

Public Types

enum InstructionDirection { NoDirection, DirectionForward, DirectionBearRight, DirectionLightRight, DirectionRight, …, DirectionBearLeft }

Properties

Public Functions

QGeoManeuver()
QGeoManeuver(const QGeoManeuver &other)
~QGeoManeuver()
QGeoManeuver::InstructionDirection direction() const
qreal distanceToNextInstruction() const
QVariantMap extendedAttributes() const
QString instructionText() const
bool isValid() const
QGeoCoordinate position() const
int timeToNextInstruction() const
QGeoCoordinate waypoint() const
QGeoManeuver &operator=(const QGeoManeuver &other)
bool operator!=(const QGeoManeuver &lhs, const QGeoManeuver &rhs)
bool operator==(const QGeoManeuver &lhs, const QGeoManeuver &rhs)

Detailed Description

QGeoRouteSegment instances can be thought of as edges on a routing graph, with QGeoManeuver instances as optional labels attached to the vertices of the graph.

The most interesting information help in a QGeoManeuver instance is normally the textual navigation to provide and the position at which to provide it, accessible by instructionText() and position() respectively.

It is also possible to determine if a routing waypoint has been passed by checking if waypoint() returns a valid QGeoCoordinate.

Member Type Documentation

enum QGeoManeuver::InstructionDirection

Describes the change in direction associated with the instruction text that is associated with a QGeoManaeuver.

ConstantValueDescription
QGeoManeuver::NoDirection0There is no direction associated with the instruction text.
QGeoManeuver::DirectionForward1The instruction indicates that the direction of travel does not need to change.
QGeoManeuver::DirectionBearRight2The instruction indicates that the direction of travel should bear to the right.
QGeoManeuver::DirectionLightRight3The instruction indicates that a light turn to the right is required.
QGeoManeuver::DirectionRight4The instruction indicates that a turn to the right is required.
QGeoManeuver::DirectionHardRight5The instruction indicates that a hard turn to the right is required.
QGeoManeuver::DirectionUTurnRight6The instruction indicates that a u-turn to the right is required.
QGeoManeuver::DirectionUTurnLeft7The instruction indicates that a u-turn to the left is required.
QGeoManeuver::DirectionHardLeft8The instruction indicates that a hard turn to the left is required.
QGeoManeuver::DirectionLeft9The instruction indicates that a turn to the left is required.
QGeoManeuver::DirectionLightLeft10The instruction indicates that a light turn to the left is required.
QGeoManeuver::DirectionBearLeft11The instruction indicates that the direction of travel should bear to the left.

Property Documentation

[read-only] direction : const InstructionDirection

This property holds the direction associated with the associated instruction.

Access functions:

QGeoManeuver::InstructionDirection direction() const

[read-only] distanceToNextInstruction : const qreal

This property holds the distance, in meters, between the point at which this instruction was issued, and the point at which the next instruction should be issued.

Access functions:

qreal distanceToNextInstruction() const

[read-only, since QtLocation 5.11] extendedAttributes : const QVariantMap

This property holds the extended attributes associated with this maneuver.

This property was introduced in QtLocation 5.11.

Access functions:

QVariantMap extendedAttributes() const

[read-only] instructionText : const QString

This property holds the textual navigation instructions.

Access functions:

QString instructionText() const

[read-only] position : const QGeoCoordinate

This property holds the position where instructionText should be displayed.

Access functions:

QGeoCoordinate position() const

[read-only] timeToNextInstruction : const int

This property holds the estimated time, in seconds, that it will take to travel from the point at which the associated instruction was issued to the point at which the next instruction should be issued.

Access functions:

int timeToNextInstruction() const

[read-only] valid : const bool

This property holds whether this maneuver is valid or not.

Invalid maneuvers are used when there is no information that needs to be attached to the endpoint of a QGeoRouteSegment instance.

Access functions:

bool isValid() const

[read-only] waypoint : const QGeoCoordinate

This property holds the waypoint associated with this maneuver.

If there is not waypoint associated with this maneuver, then this property holds an invalid QGeoCoordinate.

Access functions:

QGeoCoordinate waypoint() const

Member Function Documentation

QGeoManeuver::QGeoManeuver()

Constructs a invalid maneuver object.

The maneuver will remain invalid until one of setPosition(), setInstructionText(), setDirection(), setTimeToNextInstruction(), setDistanceToNextInstruction() or setWaypoint() is called.

QGeoManeuver::QGeoManeuver(const QGeoManeuver &other)

Constructs a maneuver object from the contents of other.

QGeoManeuver::~QGeoManeuver()

Destroys this maneuver object.

QGeoManeuver &QGeoManeuver::operator=(const QGeoManeuver &other)

Assigns other to this maneuver object and then returns a reference to this maneuver object.

Related Non-Members

bool operator!=(const QGeoManeuver &lhs, const QGeoManeuver &rhs)

Returns whether the lhs maneuver is not equal to rhs.

bool operator==(const QGeoManeuver &lhs, const QGeoManeuver &rhs)

Returns whether the lhs maneuver is equal to rhs.

© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.