QGeoRoute Class▲
-
Header: QGeoRoute
-
qmake: QT += location
-
Group: QGeoRoute is part of QtLocation-routing
I. Detailed Description▲
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()
I-1. See Also▲
See also QGeoRoutingManager
II. Property Documentation▲
II-1. [read-only] bounds : const QGeoRectangle▲
This property holds the bounding box which encompasses the entire route
Access functions:
-
bounds() const
II-2. [read-only] distance : const qreal▲
This property holds the distance covered by this route, in meters
Access functions:
-
distance() const
II-3. [read-only] extendedAttributes : const QVariantMap▲
This property holds the extended attributes associated with this route
Access functions:
-
QVariantMap extendedAttributes() const
II-4. [read-only] legIndex : const int▲
This 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
II-5. [read-only] overallRoute : const QGeoRoute▲
This 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:
-
overallRoute() const
II-6. path : QList<QGeoCoordinate>▲
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:
-
<> path() const
-
void setPath(const <> &path)
II-7. [read-only] routeId : const QString▲
This 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:
-
routeId() const
II-8. [read-only] routeLegs : const QList<QGeoRoute>▲
This property holds the route legs for a multi-waypoint route
Access functions:
-
<> routeLegs() const
II-9. [read-only] segments : const QList<QGeoRouteSegment>▲
This property holds the list of QGeoRouteSegment objects of this route
Access functions:
-
<> segments() const
II-10. [read-only] segmentsCount : const qsizetype▲
This property holds the number of segments in the route
Access functions:
-
qsizetype segmentsCount() const
II-11. [read-only] travelTime : const int▲
This property holds the estimated amount of time it will take to traverse this route, in seconds
Access functions:
-
int travelTime() const
III. Member Function Documentation▲
III-1. QGeoRoute::QGeoRoute()▲
Constructs a route object.
III-2. QGeoRoute::QGeoRoute(const QGeoRoute &other)▲
Constructs a route object from the contents of other.
III-3. QGeoRoute::~QGeoRoute()▲
Destroys this route object.
III-4. [protected] QExplicitlySharedDataPointer<QGeoRoutePrivate> &QGeoRoute::d()▲
Returns the private implementation.
III-5. 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.
III-5-1. See Also▲
See also setFirstRouteSegment()
III-6. void QGeoRoute::setFirstRouteSegment(const QGeoRouteSegment &routeSegment)▲
Sets the first route segment in the route to routeSegment.
III-6-1. See Also▲
See also firstRouteSegment()
III-7. 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().
III-7-1. See Also▲
See also travelMode()
III-8. 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().
III-8-1. See Also▲
See also setTravelMode()
III-9. QGeoRoute &QGeoRoute::operator=(const QGeoRoute &other)▲
Assigns the contents of other to this route and returns a reference to this route.