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 Class Reference

\inmodule QtLocation More...

#include <qgeomaneuver.h>

+ Inheritance diagram for QGeoManeuver:
+ Collaboration diagram for QGeoManeuver:

Public Types

enum  InstructionDirection {
  NoDirection , DirectionForward , DirectionBearRight , DirectionLightRight ,
  DirectionRight , DirectionHardRight , DirectionUTurnRight , DirectionUTurnLeft ,
  DirectionHardLeft , DirectionLeft , DirectionLightLeft , DirectionBearLeft
}
 \qmltype routeManeuver \inqmlmodule QtLocation More...
 

Public Member Functions

 QGeoManeuver ()
 Constructs a invalid maneuver object.
 
 QGeoManeuver (const QGeoManeuver &other) noexcept
 Constructs a maneuver object from the contents of other.
 
 QGeoManeuver (QGeoManeuver &&other) noexcept=default
 
 ~QGeoManeuver ()
 Destroys this maneuver object.
 
QGeoManeuveroperator= (const QGeoManeuver &other)
 Assigns other to this maneuver object and then returns a reference to this maneuver object.
 
void swap (QGeoManeuver &other) noexcept
 
bool isValid () const
 
void setPosition (const QGeoCoordinate &position)
 
QGeoCoordinate position () const
 
void setInstructionText (const QString &instructionText)
 
QString instructionText () const
 
void setDirection (InstructionDirection direction)
 
InstructionDirection direction () const
 
void setTimeToNextInstruction (int secs)
 
int timeToNextInstruction () const
 
void setDistanceToNextInstruction (qreal distance)
 
qreal distanceToNextInstruction () const
 
void setWaypoint (const QGeoCoordinate &coordinate)
 
QGeoCoordinate waypoint () const
 
void setExtendedAttributes (const QVariantMap &extendedAttributes)
 
QVariantMap extendedAttributes () const
 

Properties

QML_STRUCTURED_VALUEbool valid
 \qmlproperty bool routeManeuver::valid
 
QGeoCoordinate position
 \qmlproperty coordinate routeManeuver::position
 
QString instructionText
 \qmlproperty string routeManeuver::instructionText
 
InstructionDirection direction
 \qmlproperty enumeration routeManeuver::direction
 
int timeToNextInstruction
 \qmlproperty int routeManeuver::timeToNextInstruction
 
qreal distanceToNextInstruction
 \qmlproperty real routeManeuver::distanceToNextInstruction
 
QGeoCoordinate waypoint
 \qmlproperty coordinate routeManeuver::waypoint
 
QVariantMap extendedAttributes
 \qmlproperty Object routeManeuver::extendedAttributes
 

Friends

bool operator== (const QGeoManeuver &lhs, const QGeoManeuver &rhs) noexcept
 Returns whether the lhs maneuver is equal to rhs.
 
bool operator!= (const QGeoManeuver &lhs, const QGeoManeuver &rhs) noexcept
 Returns whether the lhs maneuver is not equal to rhs.
 

Detailed Description

\inmodule QtLocation

Since
5.6

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

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.

Definition at line 19 of file qgeomaneuver.h.

Member Enumeration Documentation

◆ InstructionDirection

\qmltype routeManeuver \inqmlmodule QtLocation

Since
QtLocation 5.5

The routeManeuver type represents the information relevant to the point at which two routeSegments meet.

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

The most interesting information held in a routeManeuver instance is normally the textual navigation to provide and the position at which to provide it, accessible by \l instructionText and \l position respectively.

Enumerator
NoDirection 
DirectionForward 
DirectionBearRight 
DirectionLightRight 
DirectionRight 
DirectionHardRight 
DirectionUTurnRight 
DirectionUTurnLeft 
DirectionHardLeft 
DirectionLeft 
DirectionLightLeft 
DirectionBearLeft 

Definition at line 36 of file qgeomaneuver.h.

Constructor & Destructor Documentation

◆ QGeoManeuver() [1/3]

QGeoManeuver::QGeoManeuver ( )

Constructs a invalid maneuver object.

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

Definition at line 115 of file qgeomaneuver.cpp.

◆ QGeoManeuver() [2/3]

QGeoManeuver::QGeoManeuver ( const QGeoManeuver & other)
defaultnoexcept

Constructs a maneuver object from the contents of other.

◆ QGeoManeuver() [3/3]

QGeoManeuver::QGeoManeuver ( QGeoManeuver && other)
defaultnoexcept

◆ ~QGeoManeuver()

QGeoManeuver::~QGeoManeuver ( )
default

Destroys this maneuver object.

Member Function Documentation

◆ direction()

QGeoManeuver::InstructionDirection QGeoManeuver::direction ( ) const

Definition at line 255 of file qgeomaneuver.cpp.

References QGeoManeuverPrivate::direction().

+ Here is the call graph for this function:

◆ distanceToNextInstruction()

qreal QGeoManeuver::distanceToNextInstruction ( ) const

Definition at line 304 of file qgeomaneuver.cpp.

References QGeoManeuverPrivate::distanceToNextInstruction().

+ Here is the call graph for this function:

◆ extendedAttributes()

QVariantMap QGeoManeuver::extendedAttributes ( ) const

Definition at line 361 of file qgeomaneuver.cpp.

References QGeoManeuverPrivate::extendedAttributes().

+ Here is the call graph for this function:

◆ instructionText()

QString QGeoManeuver::instructionText ( ) const

Definition at line 218 of file qgeomaneuver.cpp.

References QGeoManeuverPrivate::text().

+ Here is the call graph for this function:

◆ isValid()

bool QGeoManeuver::isValid ( ) const

Definition at line 175 of file qgeomaneuver.cpp.

References QGeoManeuverPrivate::valid().

+ Here is the call graph for this function:

◆ operator=()

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

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

Definition at line 132 of file qgeomaneuver.cpp.

References other().

+ Here is the call graph for this function:

◆ position()

QGeoCoordinate QGeoManeuver::position ( ) const

Definition at line 197 of file qgeomaneuver.cpp.

References QGeoManeuverPrivate::position().

+ Here is the call graph for this function:

◆ setDirection()

void QGeoManeuver::setDirection ( QGeoManeuver::InstructionDirection direction)

Definition at line 249 of file qgeomaneuver.cpp.

References direction, QGeoManeuverPrivate::setDirection(), and QGeoManeuverPrivate::setValid().

Referenced by constructRoute(), and QGeoRouteParserOsrmV5Private::parseStep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDistanceToNextInstruction()

void QGeoManeuver::setDistanceToNextInstruction ( qreal distance)

Definition at line 298 of file qgeomaneuver.cpp.

References QGeoManeuverPrivate::setDistanceToNextInstruction(), and QGeoManeuverPrivate::setValid().

Referenced by constructRoute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setExtendedAttributes()

void QGeoManeuver::setExtendedAttributes ( const QVariantMap & extendedAttributes)

Definition at line 355 of file qgeomaneuver.cpp.

References extendedAttributes, QGeoManeuverPrivate::setExtendedAttributes(), and QGeoManeuverPrivate::setValid().

+ Here is the call graph for this function:

◆ setInstructionText()

void QGeoManeuver::setInstructionText ( const QString & instructionText)

Definition at line 212 of file qgeomaneuver.cpp.

References instructionText, QGeoManeuverPrivate::setText(), and QGeoManeuverPrivate::setValid().

Referenced by constructRoute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPosition()

void QGeoManeuver::setPosition ( const QGeoCoordinate & position)

Definition at line 191 of file qgeomaneuver.cpp.

References position, QGeoManeuverPrivate::setPosition(), and QGeoManeuverPrivate::setValid().

Referenced by constructRoute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTimeToNextInstruction()

void QGeoManeuver::setTimeToNextInstruction ( int secs)

Definition at line 274 of file qgeomaneuver.cpp.

References QGeoManeuverPrivate::setTimeToNextInstruction(), and QGeoManeuverPrivate::setValid().

Referenced by constructRoute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setWaypoint()

void QGeoManeuver::setWaypoint ( const QGeoCoordinate & coordinate)

Definition at line 323 of file qgeomaneuver.cpp.

References QGeoManeuverPrivate::setValid(), and QGeoManeuverPrivate::setWaypoint().

+ Here is the call graph for this function:

◆ swap()

void QGeoManeuver::swap ( QGeoManeuver & other)
inlinenoexcept

Definition at line 59 of file qgeomaneuver.h.

References other().

+ Here is the call graph for this function:

◆ timeToNextInstruction()

int QGeoManeuver::timeToNextInstruction ( ) const

Definition at line 280 of file qgeomaneuver.cpp.

References QGeoManeuverPrivate::timeToNextInstruction().

+ Here is the call graph for this function:

◆ waypoint()

QGeoCoordinate QGeoManeuver::waypoint ( ) const

Definition at line 329 of file qgeomaneuver.cpp.

References QGeoManeuverPrivate::waypoint().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

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

Returns whether the lhs maneuver is not equal to rhs.

Definition at line 63 of file qgeomaneuver.h.

◆ operator==

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

Returns whether the lhs maneuver is equal to rhs.

Definition at line 61 of file qgeomaneuver.h.

Property Documentation

◆ direction

QGeoManeuver::direction
read

\qmlproperty enumeration routeManeuver::direction

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

\list

  • RouteManeuver.NoDirection - There is no direction associated with the instruction text
  • RouteManeuver.DirectionForward - The instruction indicates that the direction of travel does not need to change
  • RouteManeuver.DirectionBearRight - The instruction indicates that the direction of travel should bear to the right
  • RouteManeuver.DirectionLightRight - The instruction indicates that a light turn to the right is required
  • RouteManeuver.DirectionRight - The instruction indicates that a turn to the right is required
  • RouteManeuver.DirectionHardRight - The instruction indicates that a hard turn to the right is required
  • RouteManeuver.DirectionUTurnRight - The instruction indicates that a u-turn to the right is required
  • RouteManeuver.DirectionUTurnLeft - The instruction indicates that a u-turn to the left is required
  • RouteManeuver.DirectionHardLeft - The instruction indicates that a hard turn to the left is required
  • RouteManeuver.DirectionLeft - The instruction indicates that a turn to the left is required
  • RouteManeuver.DirectionLightLeft - The instruction indicates that a light turn to the left is required
  • RouteManeuver.DirectionBearLeft - The instruction indicates that the direction of travel should bear to the left \endlist

the direction associated with the associated instruction.

Definition at line 29 of file qgeomaneuver.h.

Referenced by setDirection().

◆ distanceToNextInstruction

QGeoManeuver::distanceToNextInstruction
read

\qmlproperty real routeManeuver::distanceToNextInstruction

This read-only property holds the distance, in meters, between the point at which the associated instruction was issued and the point that the next instruction should be issued.

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

Definition at line 31 of file qgeomaneuver.h.

◆ extendedAttributes

QGeoManeuver::extendedAttributes
read

\qmlproperty Object routeManeuver::extendedAttributes

This property holds the extended attributes of the maneuver and is a map. These attributes are plugin specific, and can be empty.

Consult the \l {Qt Location::Plugin References and Parameters}{plugin documentation} for what attributes are supported and how they should be used.

Note, due to limitations of the QQmlPropertyMap, it is not possible to declaratively specify the attributes in QML, assignment of attributes keys and values can only be accomplished by JavaScript.

Since
QtLocation 5.11

the extended attributes associated with this maneuver.

Since
QtLocation 5.11

Definition at line 33 of file qgeomaneuver.h.

Referenced by setExtendedAttributes().

◆ instructionText

QGeoManeuver::instructionText
read

\qmlproperty string routeManeuver::instructionText

This read-only property holds textual navigation instruction.

the textual navigation instructions.

Definition at line 28 of file qgeomaneuver.h.

Referenced by setInstructionText().

◆ position

QGeoManeuver::position
read

\qmlproperty coordinate routeManeuver::position

This read-only property holds where the \l instructionText should be displayed.

the position where \l instructionText should be displayed.

Definition at line 27 of file qgeomaneuver.h.

Referenced by setPosition().

◆ timeToNextInstruction

QGeoManeuver::timeToNextInstruction
read

\qmlproperty int routeManeuver::timeToNextInstruction

This read-only 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, in seconds.

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.

Definition at line 30 of file qgeomaneuver.h.

◆ valid

QGeoManeuver::valid
read

\qmlproperty bool routeManeuver::valid

This read-only 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.

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.

Definition at line 26 of file qgeomaneuver.h.

◆ waypoint

QGeoManeuver::waypoint
read

\qmlproperty coordinate routeManeuver::waypoint

This property holds the waypoint associated with this maneuver. Not all maneuvers have a waypoint associated with them.

the waypoint associated with this maneuver.

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

Definition at line 32 of file qgeomaneuver.h.


The documentation for this class was generated from the following files: