The QGeoRoute class represents a route between two points. 更多...
头: | #include <QGeoRoute> |
qmake: | QT += location |
Since: | Qt 5.6 |
继承者: |
该类在 Qt 5.6 引入。
QGeoRoute (const QGeoRoute & other ) | |
QGeoRoute () | |
QGeoRoute & | operator= (const QGeoRoute & other ) |
~QGeoRoute () | |
QGeoRectangle | bounds () const |
qreal | distance () const |
QVariantMap | extendedAttributes () const |
QGeoRouteSegment | firstRouteSegment () const |
QList<QGeoCoordinate> | path () const |
QGeoRouteRequest | request () const |
QString | routeId () const |
QList<QGeoRouteLeg> | routeLegs () const |
void | setBounds (const QGeoRectangle & bounds ) |
void | setDistance (qreal distance ) |
void | setExtendedAttributes (const QVariantMap & extendedAttributes ) |
void | setFirstRouteSegment (const QGeoRouteSegment & routeSegment ) |
void | setPath (const QList<QGeoCoordinate> & path ) |
void | setRequest (const QGeoRouteRequest & request ) |
void | setRouteId (const QString & id ) |
void | setRouteLegs (const QList<QGeoRouteLeg> & legs ) |
void | setTravelMode (QGeoRouteRequest::TravelMode mode ) |
void | setTravelTime (int secs ) |
QGeoRouteRequest::TravelMode | travelMode () const |
int | travelTime () const |
bool | operator!= (const QGeoRoute & other ) const |
bool | operator== (const QGeoRoute & other ) const |
QGeoRoute (const QExplicitlySharedDataPointer<QGeoRoutePrivate> & dd ) | |
QExplicitlySharedDataPointer<QGeoRoutePrivate> & | d () |
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 ()
另请参阅 QGeoRoutingManager .
[protected]
QGeoRoute::
QGeoRoute
(const
QExplicitlySharedDataPointer
<
QGeoRoutePrivate
> &
dd
)
Constructs a route object using dd as private implementation.
Constructs a route object from the contents of other .
Constructs a route object.
Assigns the contents of other to this route and returns a reference to this route.
Destroys this route object.
Returns a bounding box which encompasses the entire route.
另请参阅 setBounds ().
[protected]
QExplicitlySharedDataPointer
<
QGeoRoutePrivate
> &QGeoRoute::
d
()
Returns the private implementation.
Returns the distance covered by this route, in meters.
另请参阅 setDistance ().
Returns the extended attributes associated with this route.
该函数在 Qt 5.13 引入。
另请参阅 setExtendedAttributes ().
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 .
另请参阅 setFirstRouteSegment ().
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.
另请参阅 setPath ().
Returns the route request which describes the criteria used in the calculation of this route.
另请参阅 setRequest ().
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.
另请参阅 setRouteId ().
Returns the legs for the route.
该函数在 Qt 5.12 引入。
另请参阅 setRouteLegs () 和 QGeoRouteLeg .
Sets the bounding box which encompasses the entire route to bounds .
另请参阅 bounds ().
Sets the distance covered by this route, in meters, to distance .
另请参阅 distance ().
Sets the extended attributes extendedAttributes associated with this route.
该函数在 Qt 5.13 引入。
另请参阅 extendedAttributes ().
Sets the first route segment in the route to routeSegment .
另请参阅 firstRouteSegment ().
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.
另请参阅 path ().
Sets the route request which describes the criteria used in the calculcation of this route to request .
另请参阅 request ().
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.
另请参阅 routeId ().
Sets the route legs for a multi-waypoint route.
该函数在 Qt 5.12 引入。
另请参阅 routeLegs () 和 QGeoRouteLeg .
Sets the travel mode for this route to mode .
This should be one of the travel modes returned by request ().travelModes().
另请参阅 travelMode ().
Sets the estimated amount of time it will take to traverse this route, in seconds, to secs .
另请参阅 travelTime ().
Returns the travel mode for the this route.
This should be one of the travel modes returned by request ().travelModes().
另请参阅 setTravelMode ().
Returns the estimated amount of time it will take to traverse this route, in seconds.
另请参阅 setTravelTime ().
Returns whether this route and other are not equal.
Returns whether this route and other 相等。