![]() |
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 23 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 73 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 182 of file qgeoroute.cpp.
|
protected |
Definition at line 85 of file qgeoroute.cpp.
|
protected |
Returns the private implementation.
Definition at line 80 of file qgeoroute.cpp.
qreal QGeoRoute::distance | ( | ) | const |
Definition at line 286 of file qgeoroute.cpp.
QVariantMap QGeoRoute::extendedAttributes | ( | ) | const |
Definition at line 398 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 204 of file qgeoroute.cpp.
int QGeoRoute::legIndex | ( | ) | const |
Definition at line 425 of file qgeoroute.cpp.
Assigns the contents of other to this route and returns a reference to this route.
Definition at line 104 of file qgeoroute.cpp.
QGeoRoute QGeoRoute::overallRoute | ( | ) | const |
Definition at line 448 of file qgeoroute.cpp.
QList< QGeoCoordinate > QGeoRoute::path | ( | ) | const |
Definition at line 338 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 162 of file qgeoroute.cpp.
QString QGeoRoute::routeId | ( | ) | const |
Definition at line 146 of file qgeoroute.cpp.
Definition at line 365 of file qgeoroute.cpp.
QList< QGeoRouteSegment > QGeoRoute::segments | ( | ) | const |
Definition at line 244 of file qgeoroute.cpp.
qsizetype QGeoRoute::segmentsCount | ( | ) | const |
Definition at line 223 of file qgeoroute.cpp.
void QGeoRoute::setBounds | ( | const QGeoRectangle & | bounds | ) |
Definition at line 177 of file qgeoroute.cpp.
Definition at line 281 of file qgeoroute.cpp.
void QGeoRoute::setExtendedAttributes | ( | const QVariantMap & | extendedAttributes | ) |
Definition at line 393 of file qgeoroute.cpp.
void QGeoRoute::setFirstRouteSegment | ( | const QGeoRouteSegment & | routeSegment | ) |
Sets the first route segment in the route to routeSegment.
Definition at line 190 of file qgeoroute.cpp.
void QGeoRoute::setLegIndex | ( | int | idx | ) |
Definition at line 420 of file qgeoroute.cpp.
Definition at line 443 of file qgeoroute.cpp.
void QGeoRoute::setPath | ( | const QList< QGeoCoordinate > & | path | ) |
Definition at line 332 of file qgeoroute.cpp.
void QGeoRoute::setRequest | ( | const QGeoRouteRequest & | request | ) |
Definition at line 157 of file qgeoroute.cpp.
Definition at line 141 of file qgeoroute.cpp.
Definition at line 360 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 296 of file qgeoroute.cpp.
void QGeoRoute::setTravelTime | ( | int | secs | ) |
Definition at line 261 of file qgeoroute.cpp.
Definition at line 50 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 306 of file qgeoroute.cpp.
int QGeoRoute::travelTime | ( | ) | const |
Definition at line 266 of file qgeoroute.cpp.
Returns whether the routes lhs and rhs are not equal.
Definition at line 54 of file qgeoroute.h.
Returns whether the routes lhs and rhs are equal.
Definition at line 52 of file qgeoroute.h.
|
friend |
Definition at line 103 of file qgeoroute.h.
|
friend |
Definition at line 104 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 30 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 32 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 35 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 36 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 37 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 33 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 29 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 34 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 39 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 38 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 31 of file qgeoroute.h.