The QGeoRoute class represents a route between two points. More...
| Header: | #include <QGeoRoute> |
| qmake: | QT += location |
|
|
| QGeoRoute() | |
| QGeoRoute(const QGeoRoute &other) | |
| ~QGeoRoute() | |
| QGeoRectangle | bounds() const |
| qreal | distance() const |
| QVariantMap | extendedAttributes() const |
| QGeoRouteSegment | firstRouteSegment() const |
| int | legIndex() const |
| QGeoRoute | overallRoute() const |
| QList<QGeoCoordinate> | path() const |
| QString | routeId() const |
| QList<QGeoRoute> | routeLegs() const |
| QList<QGeoRouteSegment> | segments() const |
| qsizetype | segmentsCount() const |
| void | setFirstRouteSegment(const QGeoRouteSegment &routeSegment) |
| void | setPath(const QList<QGeoCoordinate> &path) |
| void | setTravelMode(QGeoRouteRequest::TravelMode mode) |
| QGeoRouteRequest::TravelMode | travelMode() const |
| int | travelTime() const |
| QGeoRoute & | operator=(const QGeoRoute &other) |
| QExplicitlySharedDataPointer<QGeoRoutePrivate> & | d() |
| bool | operator!=(const QGeoRoute &lhs, const QGeoRoute &rhs) |
| bool | operator==(const QGeoRoute &lhs, const QGeoRoute &rhs) |
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()
See also QGeoRoutingManager.
[read-only] bounds : const QGeoRectangleThis property holds the bounding box which encompasses the entire route
Access functions:
| QGeoRectangle | bounds() const |
[read-only] distance : const qrealThis property holds the distance covered by this route, in meters
Access functions:
| qreal | distance() const |
[read-only] extendedAttributes : const QVariantMapThis property holds the extended attributes associated with this route
Access functions:
| QVariantMap | extendedAttributes() const |
[read-only] legIndex : const intThis property holds 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.
Access functions:
| int | legIndex() const |
[read-only] overallRoute : const QGeoRouteThis property holds 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.
Access functions:
| QGeoRoute | overallRoute() const |
This property holds 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.
Access functions:
| QList<QGeoCoordinate> | path() const |
| void | setPath(const QList<QGeoCoordinate> &path) |
[read-only] routeId : const QStringThis property holds 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.
Access functions:
| QString | routeId() const |
[read-only] routeLegs : const QList<QGeoRoute>This property holds the route legs for a multi-waypoint route
Access functions:
| QList<QGeoRoute> | routeLegs() const |
[read-only] segments : const QList<QGeoRouteSegment>This property holds the list of QGeoRouteSegment objects of this route
Access functions:
| QList<QGeoRouteSegment> | segments() const |
[read-only] segmentsCount : const qsizetypeThis property holds the number of segments in the route
Access functions:
| qsizetype | segmentsCount() const |
[read-only] travelTime : const intThis property holds the estimated amount of time it will take to traverse this route, in seconds
Access functions:
| int | travelTime() const |
Constructs a route object.
[noexcept] QGeoRoute::QGeoRoute(const QGeoRoute &other)Constructs a route object from the contents of other.
[noexcept] QGeoRoute::~QGeoRoute()Destroys this route object.
[protected] QExplicitlySharedDataPointer<QGeoRoutePrivate> &QGeoRoute::d()Returns the private implementation.
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.
See also setFirstRouteSegment().
Sets the first route segment in the route to routeSegment.
See also firstRouteSegment().
Sets the travel mode for this route to mode.
This should be one of the travel modes returned by request().travelModes().
See also travelMode().
Returns the travel mode for the this route.
This should be one of the travel modes returned by request().travelModes().
See also setTravelMode().
[noexcept] QGeoRoute &QGeoRoute::operator=(const QGeoRoute &other)Assigns the contents of other to this route and returns a reference to this route.