![]() |
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 <qgeoroute.h>
Public Member Functions | |
| QGeoRoute () | |
| \qmlvaluetype route \inqmlmodule QtLocation | |
| QGeoRoute (const QGeoRoute &other) noexcept | |
| Constructs a route object from the contents of other. | |
| QGeoRoute (QGeoRoute &&other) noexcept=default | |
| ~QGeoRoute () | |
| Destroys this route object. | |
| QGeoRoute & | operator= (const QGeoRoute &other) noexcept |
| Assigns the contents of other to this route and returns a reference to this route. | |
| void | swap (QGeoRoute &other) noexcept |
| void | setRouteId (const QString &id) |
| QString | routeId () const |
| void | setRequest (const QGeoRouteRequest &request) |
| QGeoRouteRequest | request () const |
| the route request which describes the criteria used in the calculation of this route | |
| void | setBounds (const QGeoRectangle &bounds) |
| QGeoRectangle | bounds () const |
| void | setFirstRouteSegment (const QGeoRouteSegment &routeSegment) |
| Sets the first route segment in the route to routeSegment. | |
| QGeoRouteSegment | firstRouteSegment () const |
| Returns the first route segment in the route. | |
| qsizetype | segmentsCount () const |
| QList< QGeoRouteSegment > | segments () const |
| void | setTravelTime (int secs) |
| int | travelTime () const |
| void | setDistance (qreal distance) |
| qreal | distance () const |
| void | setTravelMode (QGeoRouteRequest::TravelMode mode) |
| Sets the travel mode for this route to mode. | |
| QGeoRouteRequest::TravelMode | travelMode () const |
| Returns the travel mode for the this route. | |
| void | setPath (const QList< QGeoCoordinate > &path) |
| QList< QGeoCoordinate > | path () const |
| void | setRouteLegs (const QList< QGeoRoute > &legs) |
| QList< QGeoRoute > | routeLegs () const |
| void | setExtendedAttributes (const QVariantMap &extendedAttributes) |
| QVariantMap | extendedAttributes () const |
| void | setLegIndex (int idx) |
| int | legIndex () const |
| void | setOverallRoute (const QGeoRoute &route) |
| QGeoRoute | overallRoute () const |
Protected Member Functions | |
| QExplicitlySharedDataPointer< QGeoRoutePrivate > & | d () |
| Returns the private implementation. | |
| const QExplicitlySharedDataPointer< QGeoRoutePrivate > & | const_d () const |
Properties | |
| QML_STRUCTURED_VALUEQString | routeId |
| the identifier of this route | |
| QGeoRectangle | bounds |
| \qmlproperty geoRectangle QtLocation::route::bounds | |
| int | travelTime |
| \qmlproperty int QtLocation::route::travelTime | |
| qreal | distance |
| \qmlproperty real QtLocation::route::distance | |
| QList< QGeoCoordinate > | path |
| \qmlproperty list<coordinate> QtLocation::route::path | |
| QList< QGeoRoute > | routeLegs |
| \qmlproperty list<route> QtLocation::route::legs | |
| QVariantMap | extendedAttributes |
| \qmlproperty Object route::extendedAttributes | |
| int | legIndex |
| \qmlproperty int QtLocation::route::legIndex | |
| QGeoRoute | overallRoute |
| \qmlproperty Route QtLocation::route::overallRoute | |
| qsizetype | segmentsCount |
| \qmlmethod int QtLocation::route::segmentsCount() | |
| QList< QGeoRouteSegment > | segments |
| \qmlproperty list<routeSegment> QtLocation::route::segments | |
Friends | |
| class | QDeclarativeGeoRoute |
| class | QGeoRoutePrivate |
| bool | operator== (const QGeoRoute &lhs, const QGeoRoute &rhs) noexcept |
| Returns whether the routes lhs and rhs are equal. | |
| bool | operator!= (const QGeoRoute &lhs, const QGeoRoute &rhs) noexcept |
| Returns whether the routes lhs and rhs are not equal. | |
\inmodule QtLocation
The QGeoRoute class represents a route between two points.
A QGeoRoute object contains high level information about a route, such as the length the route, the estimated travel time for the route, and enough information to render a basic image of the route on a map.
The QGeoRoute object also contains a list of QGeoRouteSegment objecs which describe subsections of the route in greater detail.
Routing information is normally requested using QGeoRoutingManager::calculateRoute(), which returns a QGeoRouteReply instance. If the operation is completed successfully the routing information can be accessed with QGeoRouteReply::routes()
Definition at line 24 of file qgeoroute.h.
| QGeoRoute::QGeoRoute | ( | ) |
\qmlvaluetype route \inqmlmodule QtLocation
The route type represents one geographical route.
A route type contains high level information about a route, such as the length the route, the estimated travel time for the route, and enough information to render a basic image of the route on a map.
The QGeoRoute object also contains a list of \l routeSegment objects which describe subsections of the route in greater detail.
The primary means of acquiring route objects is \l RouteModel.
Definition at line 74 of file qgeoroute.cpp.
|
defaultnoexcept |
Constructs a route object from the contents of other.
|
defaultnoexcept |
|
default |
Destroys this route object.
| QGeoRectangle QGeoRoute::bounds | ( | ) | const |
Definition at line 183 of file qgeoroute.cpp.
|
protected |
Definition at line 86 of file qgeoroute.cpp.
|
protected |
Returns the private implementation.
Definition at line 81 of file qgeoroute.cpp.
| qreal QGeoRoute::distance | ( | ) | const |
Definition at line 287 of file qgeoroute.cpp.
| QVariantMap QGeoRoute::extendedAttributes | ( | ) | const |
Definition at line 399 of file qgeoroute.cpp.
| QGeoRouteSegment QGeoRoute::firstRouteSegment | ( | ) | const |
Returns the first route segment in the route.
Will return an invalid route segment if there are no route segments associated with the route.
The remaining route segments can be accessed sequentially with QGeoRouteSegment::nextRouteSegment.
Definition at line 205 of file qgeoroute.cpp.
| int QGeoRoute::legIndex | ( | ) | const |
Definition at line 426 of file qgeoroute.cpp.
Assigns the contents of other to this route and returns a reference to this route.
Definition at line 105 of file qgeoroute.cpp.
| QGeoRoute QGeoRoute::overallRoute | ( | ) | const |
Definition at line 449 of file qgeoroute.cpp.
| QList< QGeoCoordinate > QGeoRoute::path | ( | ) | const |
Definition at line 339 of file qgeoroute.cpp.
| QGeoRouteRequest QGeoRoute::request | ( | ) | const |
the route request which describes the criteria used in the calculation of this route
Definition at line 163 of file qgeoroute.cpp.
| QString QGeoRoute::routeId | ( | ) | const |
Definition at line 147 of file qgeoroute.cpp.
Definition at line 366 of file qgeoroute.cpp.
| QList< QGeoRouteSegment > QGeoRoute::segments | ( | ) | const |
Definition at line 245 of file qgeoroute.cpp.
| qsizetype QGeoRoute::segmentsCount | ( | ) | const |
Definition at line 224 of file qgeoroute.cpp.
| void QGeoRoute::setBounds | ( | const QGeoRectangle & | bounds | ) |
Definition at line 178 of file qgeoroute.cpp.
Definition at line 282 of file qgeoroute.cpp.
| void QGeoRoute::setExtendedAttributes | ( | const QVariantMap & | extendedAttributes | ) |
Definition at line 394 of file qgeoroute.cpp.
| void QGeoRoute::setFirstRouteSegment | ( | const QGeoRouteSegment & | routeSegment | ) |
Sets the first route segment in the route to routeSegment.
Definition at line 191 of file qgeoroute.cpp.
| void QGeoRoute::setLegIndex | ( | int | idx | ) |
Definition at line 421 of file qgeoroute.cpp.
Definition at line 444 of file qgeoroute.cpp.
| void QGeoRoute::setPath | ( | const QList< QGeoCoordinate > & | path | ) |
Definition at line 333 of file qgeoroute.cpp.
| void QGeoRoute::setRequest | ( | const QGeoRouteRequest & | request | ) |
Definition at line 158 of file qgeoroute.cpp.
Definition at line 142 of file qgeoroute.cpp.
Definition at line 361 of file qgeoroute.cpp.
| void QGeoRoute::setTravelMode | ( | QGeoRouteRequest::TravelMode | mode | ) |
Sets the travel mode for this route to mode.
This should be one of the travel modes returned by request().travelModes().
Definition at line 297 of file qgeoroute.cpp.
| void QGeoRoute::setTravelTime | ( | int | secs | ) |
Definition at line 262 of file qgeoroute.cpp.
Definition at line 51 of file qgeoroute.h.
| QGeoRouteRequest::TravelMode QGeoRoute::travelMode | ( | ) | const |
Returns the travel mode for the this route.
This should be one of the travel modes returned by request().travelModes().
Definition at line 307 of file qgeoroute.cpp.
| int QGeoRoute::travelTime | ( | ) | const |
Definition at line 267 of file qgeoroute.cpp.
Returns whether the routes lhs and rhs are not equal.
Definition at line 55 of file qgeoroute.h.
Returns whether the routes lhs and rhs are equal.
Definition at line 53 of file qgeoroute.h.
|
friend |
Definition at line 104 of file qgeoroute.h.
|
friend |
Definition at line 105 of file qgeoroute.h.
|
read |
\qmlproperty geoRectangle QtLocation::route::bounds
Read-only property which holds a bounding box which encompasses the entire route.
the bounding box which encompasses the entire route
Definition at line 31 of file qgeoroute.h.
|
read |
\qmlproperty real QtLocation::route::distance
Read-only property which holds distance covered by this route, in meters.
the distance covered by this route, in meters
Definition at line 33 of file qgeoroute.h.
|
read |
\qmlproperty Object route::extendedAttributes
This property holds the extended attributes of the route 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.
the extended attributes associated with this route
Definition at line 36 of file qgeoroute.h.
|
read |
\qmlproperty int QtLocation::route::legIndex
Read-only property which holds the index of the leg within the containing route's list of QtLocation::route::legs. The index is -1 if this route is not a leg within an overall route.
the leg index of this route
The index of the leg inside the containing QGeoRoute::routeLegs list can be used to find the next legs.
Definition at line 37 of file qgeoroute.h.
|
read |
\qmlproperty Route QtLocation::route::overallRoute
Read-only property which holds the route that contains this leg.
the route that contains this route leg
This this route is not a leg within an overall route, then this property holds an empty route.
Definition at line 38 of file qgeoroute.h.
|
readwrite |
\qmlproperty list<coordinate> QtLocation::route::path
Read-only property which holds the geographical coordinates of this route. 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 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 34 of file qgeoroute.h.
|
read |
the identifier of this route
Service providers which support the updating of routes commonly assign identifiers to routes. If this route came from such a service provider, then changing the identifier will probably cause route updates to stop working.
Definition at line 30 of file qgeoroute.h.
\qmlproperty list<route> QtLocation::route::legs
Returns the route legs associated with this route. Route legs are the sub-routes between each two adjacent waypoints. The result may be empty, if this level of detail is not supported by the backend.
the route legs for a multi-waypoint route
Definition at line 35 of file qgeoroute.h.
|
read |
\qmlproperty list<routeSegment> QtLocation::route::segments
Read-only property which holds the list of \l routeSegment objects of this route.
To access individual segments you can use standard list accessors: 'segments.length' indicates the number of objects and 'segments[index starting from zero]' gives the actual objects.
the list of QGeoRouteSegment objects of this route
Definition at line 40 of file qgeoroute.h.
|
read |
\qmlmethod int QtLocation::route::segmentsCount()
Returns the number of segments in the route
the number of segments in the route
Definition at line 39 of file qgeoroute.h.
|
read |
\qmlproperty int QtLocation::route::travelTime
Read-only property which holds the estimated amount of time it will take to traverse this route, in seconds.
the estimated amount of time it will take to traverse this route, in seconds
Definition at line 32 of file qgeoroute.h.