QGeoRoute Class▲
-
Header: QGeoRoute
-
Since: Qt 5.6
-
qmake: QT += location
-
Inherited By: QGeoRouteLeg
-
Group: QGeoRoute is part of QtLocation-routing
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()
See Also▲
See also QGeoRoutingManager
Member Function Documentation▲
QGeoRoute::QGeoRoute()▲
Constructs a route object.
[protected] QGeoRoute::QGeoRoute(const QExplicitlySharedDataPointer<QGeoRoutePrivate> &dd)▲
Constructs a route object using dd as private implementation.
QGeoRoute::QGeoRoute(const QGeoRoute &other)▲
Constructs a route object from the contents of other.
QGeoRoute::~QGeoRoute()▲
Destroys this route object.
QGeoRectangle QGeoRoute::bounds() const▲
[protected] QExplicitlySharedDataPointer<QGeoRoutePrivate> &QGeoRoute::d()▲
Returns the private implementation.
qreal QGeoRoute::distance() const▲
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.
See Also▲
See also setFirstRouteSegment()
QList<QGeoCoordinate> QGeoRoute::path() const▲
Returns 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.
See Also▲
See also setPath()
QGeoRouteRequest QGeoRoute::request() const▲
Returns the route request which describes the criteria used in the calculation of this route.
See Also▲
See also setRequest()
QString QGeoRoute::routeId() const▲
Returns the identifier of this route.
Service providers which support the updating of routes commonly assign identifiers to routes. If this route did not come from such a service provider the function will return an empty string.
See Also▲
See also setRouteId()
[since 5.12] QList<QGeoRouteLeg> QGeoRoute::routeLegs() const▲
Returns the legs for the route.
This function was introduced in Qt 5.12.
See Also▲
See also setRouteLegs(), QGeoRouteLeg
void QGeoRoute::setBounds(const QGeoRectangle &bounds)▲
void QGeoRoute::setDistance(qreal distance)▲
void QGeoRoute::setFirstRouteSegment(const QGeoRouteSegment &routeSegment)▲
void QGeoRoute::setPath(const QList<QGeoCoordinate> &path)▲
Sets the geometric shape of the route to path.
The coordinates in path should be listed in the order in which they would be traversed by someone traveling along this segment of the route.
See Also▲
See also path()
void QGeoRoute::setRequest(const QGeoRouteRequest &request)▲
Sets the route request which describes the criteria used in the calculcation of this route to request.
See Also▲
See also request()
void QGeoRoute::setRouteId(const QString &id)▲
Sets the identifier of this route to id.
Service providers which support the updating of routes commonly assign identifiers to routes. If this route came from such a service provider changing the identifier will probably cause route updates to stop working.
See Also▲
See also routeId()
[since 5.12] void QGeoRoute::setRouteLegs(const QList<QGeoRouteLeg> &legs)▲
Sets the route legs for a multi-waypoint route.
This function was introduced in Qt 5.12.
See Also▲
See also routeLegs(), QGeoRouteLeg
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().
See Also▲
See also travelMode()
void QGeoRoute::setTravelTime(int secs)▲
Sets the estimated amount of time it will take to traverse this route, in seconds, to secs.
See Also▲
See also travelTime()
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().
See Also▲
See also setTravelMode()
int QGeoRoute::travelTime() const▲
Returns the estimated amount of time it will take to traverse this route, in seconds.
See Also▲
See also setTravelTime()
bool QGeoRoute::operator!=(const QGeoRoute &other) const▲
Returns whether this route and other are not equal.
QGeoRoute &QGeoRoute::operator=(const QGeoRoute &other)▲
Assigns the contents of other to this route and returns a reference to this route.
bool QGeoRoute::operator==(const QGeoRoute &other) const▲
Returns whether this route and other are equal.