![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtLocation More...
#include <qgeoroutesegment.h>
Public Member Functions | |
QGeoRouteSegment () | |
\qmltype routeSegment \inqmlmodule QtLocation | |
QGeoRouteSegment (const QGeoRouteSegment &other) noexcept | |
Constructs a route segment object from the contents of other. | |
QGeoRouteSegment (QGeoRouteSegment &&other) noexcept=default | |
~QGeoRouteSegment () | |
Destroys this route segment object. | |
QGeoRouteSegment & | operator= (const QGeoRouteSegment &other) noexcept |
Assigns other to this route segment object and then returns a reference to this route segment object. | |
void | swap (QGeoRouteSegment &other) noexcept |
bool | isValid () const |
Returns whether this route segment is valid or not. | |
bool | isLegLastSegment () const |
Returns whether this route segment is the last segment of a route leg. | |
void | setNextRouteSegment (const QGeoRouteSegment &routeSegment) |
Sets the next route segment in the route to routeSegment. | |
QGeoRouteSegment | nextRouteSegment () const |
Returns the next route segment in the route. | |
void | setTravelTime (int secs) |
int | travelTime () const |
void | setDistance (qreal distance) |
qreal | distance () const |
void | setPath (const QList< QGeoCoordinate > &path) |
QList< QGeoCoordinate > | path () const |
void | setManeuver (const QGeoManeuver &maneuver) |
QGeoManeuver | maneuver () const |
Properties | |
QML_STRUCTURED_VALUEint | travelTime |
\qmlproperty int QtLocation::routeSegment::travelTime | |
qreal | distance |
\qmlproperty real QtLocation::routeSegment::distance | |
QList< QGeoCoordinate > | path |
\qmlproperty list<coordinate> QtLocation::routeSegment::path | |
QGeoManeuver | maneuver |
\qmlproperty RouteManeuver QtLocation::routeSegment::maneuver | |
Friends | |
class | QGeoRouteSegmentPrivate |
bool | operator== (const QGeoRouteSegment &lhs, const QGeoRouteSegment &rhs) noexcept |
Returns whether the route segments lhs and rhs are equal. | |
bool | operator!= (const QGeoRouteSegment &lhs, const QGeoRouteSegment &rhs) noexcept |
Returns whether the route segments lhs and rhs are not equal. | |
\inmodule QtLocation
The QGeoRouteSegment class represents a segment of a route.
A QGeoRouteSegment instance has information about the physical layout of the route segment, the length of the route and estimated time required to traverse the route segment and an optional QGeoManeuver associated with the beginning of the route segment.
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.
Definition at line 20 of file qgeoroutesegment.h.
QGeoRouteSegment::QGeoRouteSegment | ( | ) |
\qmltype routeSegment \inqmlmodule QtLocation
The routeSegment type represents a segment of a Route.
A routeSegment instance has information about the physical layout of the route segment, the length of the route and estimated time required to traverse the route segment and optional \l {routeManeuver}s associated with the end of the route segment.
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 primary means of acquiring Route objects is via Routes via \l RouteModel.
Definition at line 68 of file qgeoroutesegment.cpp.
|
defaultnoexcept |
Constructs a route segment object from the contents of other.
|
defaultnoexcept |
|
default |
Destroys this route segment object.
qreal QGeoRouteSegment::distance | ( | ) | const |
Definition at line 212 of file qgeoroutesegment.cpp.
bool QGeoRouteSegment::isLegLastSegment | ( | ) | const |
Returns whether this route segment is the last segment of a route leg.
Definition at line 138 of file qgeoroutesegment.cpp.
bool QGeoRouteSegment::isValid | ( | ) | const |
Returns whether this route segment is valid or not.
If nextRouteSegment() is called on the last route segment of a route, the returned value will be an invalid route segment.
Definition at line 128 of file qgeoroutesegment.cpp.
QGeoManeuver QGeoRouteSegment::maneuver | ( | ) | const |
Definition at line 271 of file qgeoroutesegment.cpp.
QGeoRouteSegment QGeoRouteSegment::nextRouteSegment | ( | ) | const |
Returns the next route segment in the route.
Will return an invalid route segment if this is the last route segment in the route.
Definition at line 163 of file qgeoroutesegment.cpp.
|
noexcept |
Assigns other to this route segment object and then returns a reference to this route segment object.
Definition at line 92 of file qgeoroutesegment.cpp.
QList< QGeoCoordinate > QGeoRouteSegment::path | ( | ) | const |
Definition at line 244 of file qgeoroutesegment.cpp.
Definition at line 206 of file qgeoroutesegment.cpp.
void QGeoRouteSegment::setManeuver | ( | const QGeoManeuver & | maneuver | ) |
Definition at line 265 of file qgeoroutesegment.cpp.
void QGeoRouteSegment::setNextRouteSegment | ( | const QGeoRouteSegment & | routeSegment | ) |
Sets the next route segment in the route to routeSegment.
Definition at line 151 of file qgeoroutesegment.cpp.
void QGeoRouteSegment::setPath | ( | const QList< QGeoCoordinate > & | path | ) |
Definition at line 238 of file qgeoroutesegment.cpp.
void QGeoRouteSegment::setTravelTime | ( | int | secs | ) |
Definition at line 184 of file qgeoroutesegment.cpp.
|
inlinenoexcept |
Definition at line 39 of file qgeoroutesegment.h.
int QGeoRouteSegment::travelTime | ( | ) | const |
Definition at line 190 of file qgeoroutesegment.cpp.
|
friend |
Returns whether the route segments lhs and rhs are not equal.
The value of nextRouteSegment() is not considered in the comparison.
Definition at line 43 of file qgeoroutesegment.h.
|
friend |
Returns whether the route segments lhs and rhs are equal.
The value of nextRouteSegment() is not considered in the comparison.
Definition at line 41 of file qgeoroutesegment.h.
|
friend |
Definition at line 70 of file qgeoroutesegment.h.
|
read |
\qmlproperty real QtLocation::routeSegment::distance
Read-only property which holds the distance covered by this segment of the route, in meters.
the distance covered by this segment of the route, in meters.
Definition at line 27 of file qgeoroutesegment.h.
|
read |
\qmlproperty RouteManeuver QtLocation::routeSegment::maneuver
Read-only property which holds the maneuver for this route segment.
Will return invalid maneuver if no information has been attached to the endpoint of this route segment.
the maneuver for this route segment.
Holds an invalid QGeoManeuver if no information has been attached to the starting point of this route segment.
Definition at line 29 of file qgeoroutesegment.h.
|
read |
\qmlproperty list<coordinate> QtLocation::routeSegment::path
Read-only property which holds the geographical coordinates of this segment. Coordinates are listed in the order in which they would be traversed by someone traveling along this segment of the route.
To access individual segments you can use standard list accessors: 'path.length' indicates the number of objects and 'path[index starting from zero]' gives the actual object.
the geometric shape of this route segment of the route.
The coordinates should be listed in the order in which they would be traversed by someone traveling along this segment of the route.
Definition at line 28 of file qgeoroutesegment.h.
|
read |
\qmlproperty int QtLocation::routeSegment::travelTime
Read-only property which holds the estimated amount of time it will take to traverse this segment, in seconds.
the estimated amount of time, in seconds, that it will take to traverse this segment.
Definition at line 26 of file qgeoroutesegment.h.