![]() |
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 <qgeorouterequest.h>
Public Types | |
enum | TravelMode { CarTravel = 0x0001 , PedestrianTravel = 0x0002 , BicycleTravel = 0x0004 , PublicTransitTravel = 0x0008 , TruckTravel = 0x0010 } |
Defines modes of travel to be used for a route. More... | |
enum | FeatureType { NoFeature = 0x00000000 , TollFeature = 0x00000001 , HighwayFeature = 0x00000002 , PublicTransitFeature = 0x00000004 , FerryFeature = 0x00000008 , TunnelFeature = 0x00000010 , DirtRoadFeature = 0x00000020 , ParksFeature = 0x00000040 , MotorPoolLaneFeature = 0x00000080 , TrafficFeature = 0x00000100 } |
Defines a feature which is important to the planning of a route. More... | |
enum | FeatureWeight { NeutralFeatureWeight = 0x00000000 , PreferFeatureWeight = 0x00000001 , RequireFeatureWeight = 0x00000002 , AvoidFeatureWeight = 0x00000004 , DisallowFeatureWeight = 0x00000008 } |
Defines the weight to associate with a feature during the planning of a route. More... | |
enum | RouteOptimization { ShortestRoute = 0x0001 , FastestRoute = 0x0002 , MostEconomicRoute = 0x0004 , MostScenicRoute = 0x0008 } |
Defines the type of optimization which is applied to the planning of the route. More... | |
enum | SegmentDetail { NoSegmentData = 0x0000 , BasicSegmentData = 0x0001 } |
Defines the amount of route segment information that should be included with the route. More... | |
enum | ManeuverDetail { NoManeuvers = 0x0000 , BasicManeuvers = 0x0001 } |
Defines the amount of maneuver information that should be included with the route. More... | |
Public Member Functions | |
QGeoRouteRequest (const QList< QGeoCoordinate > &waypoints=QList< QGeoCoordinate >()) | |
Constructs a request to calculate a route through the coordinates waypoints. | |
QGeoRouteRequest (const QGeoCoordinate &origin, const QGeoCoordinate &destination) | |
Constructs a request to calculate a route between origin and destination. | |
QGeoRouteRequest (const QGeoRouteRequest &other) noexcept | |
Constructs a route request object from the contents of other. | |
QGeoRouteRequest (QGeoRouteRequest &&other) noexcept=default | |
~QGeoRouteRequest () | |
Destroys the request. | |
QGeoRouteRequest & | operator= (const QGeoRouteRequest &other) noexcept |
Assigns other to this route request object and then returns a reference to this route request object. | |
void | swap (QGeoRouteRequest &other) noexcept |
void | setWaypoints (const QList< QGeoCoordinate > &waypoints) |
Sets waypoints as the waypoints that the route should pass through. | |
QList< QGeoCoordinate > | waypoints () const |
Returns the waypoints that the route will pass through. | |
void | setExcludeAreas (const QList< QGeoRectangle > &areas) |
Sets areas as excluded areas that the route must not cross. | |
QList< QGeoRectangle > | excludeAreas () const |
Returns areas the route must not cross. | |
void | setNumberAlternativeRoutes (int alternatives) |
Sets the number of alternative routes to request to alternatives. | |
int | numberAlternativeRoutes () const |
Returns the number of alternative routes which will be requested. | |
void | setTravelModes (TravelModes travelModes) |
Sets the travel modes which should be considered during the planning of the route to travelModes. | |
TravelModes | travelModes () const |
Returns the travel modes which this request specifies should be considered during the planning of the route. | |
void | setFeatureWeight (FeatureType featureType, FeatureWeight featureWeight) |
Assigns the weight featureWeight to the feature featureType during the planning of the route. | |
FeatureWeight | featureWeight (FeatureType featureType) const |
Returns the weight assigned to featureType in the planning of the route. | |
QList< FeatureType > | featureTypes () const |
Returns the list of features that will be considered when planning the route. | |
void | setRouteOptimization (RouteOptimizations optimization) |
Sets the optimization criteria to use while planning the route to optimization. | |
RouteOptimizations | routeOptimization () const |
Returns the optimization criteria which this request specifies should be used while planning the route. | |
void | setSegmentDetail (SegmentDetail segmentDetail) |
Sets the level of detail to use when representing routing segments to segmentDetail. | |
SegmentDetail | segmentDetail () const |
Returns the level of detail which will be used in the representation of routing segments. | |
void | setManeuverDetail (ManeuverDetail maneuverDetail) |
Sets the level of detail to use when representing routing maneuvers to maneuverDetail. | |
ManeuverDetail | maneuverDetail () const |
Returns the level of detail which will be used in the representation of routing maneuvers. | |
void | setDepartureTime (const QDateTime &departureTime) |
Sets the departure time departureTime for the route calculation. | |
QDateTime | departureTime () const |
Returns the departure time in the request. | |
Friends | |
bool | operator== (const QGeoRouteRequest &lhs, const QGeoRouteRequest &rhs) noexcept |
Returns whether the route requests lhs and rhs are equal. | |
bool | operator!= (const QGeoRouteRequest &lhs, const QGeoRouteRequest &rhs) noexcept |
Returns whether the route requests lhs and rhs are not equal. | |
\inmodule QtLocation
The QGeoRouteRequest class represents the parameters and restrictions which define a request for routing information.
The default state of a QGeoRouteRequest instance will result in a request for basic route segment and navigation maneuvers describing the fastest route by car which covers the given waypoints.
There may be significant variation in the features supported by different providers of routing information, or even in the features supported by the same provider if different levels of authorization are used.
There are several functions in QGeoRoutingManager which can be used to check which features are supported with the current provider and authorization level.
Definition at line 20 of file qgeorouterequest.h.
Defines a feature which is important to the planning of a route.
These values will be used in combination with QGeoRouteRequest::FeatureWeight to determine if they should or should not be part of the route.
\value NoFeature Used by QGeoRoutingManager::supportedFeatureTypes() to indicate that no features will be taken into account when planning the route. \value TollFeature Consdier tollways when planning the route. \value HighwayFeature Consider highways when planning the route. \value PublicTransitFeature Consider public transit when planning the route. \value FerryFeature Consider ferries when planning the route. \value TunnelFeature Consider tunnels when planning the route. \value DirtRoadFeature Consider dirt roads when planning the route. \value ParksFeature Consider parks when planning the route. \value MotorPoolLaneFeature Consider motor pool lanes when planning the route. \value TrafficFeature Consider the current traffic situation when planning the route. Since QtLocation 5.10
Enumerator | |
---|---|
NoFeature | |
TollFeature | |
HighwayFeature | |
PublicTransitFeature | |
FerryFeature | |
TunnelFeature | |
DirtRoadFeature | |
ParksFeature | |
MotorPoolLaneFeature | |
TrafficFeature |
Definition at line 32 of file qgeorouterequest.h.
Defines the weight to associate with a feature during the planning of a route.
These values will be used in combination with QGeoRouteRequest::Feature to determine if they should or should not be part of the route.
\value NeutralFeatureWeight The presence or absence of the feature will not affect the planning of the route. \value PreferFeatureWeight Routes which contain the feature will be preferred over those that do not. \value RequireFeatureWeight Only routes which contain the feature will be considered, otherwise no route will be returned. \value AvoidFeatureWeight Routes which do not contain the feature will be preferred over those that do. \value DisallowFeatureWeight Only routes which do not contain the feature will be considered, otherwise no route will be returned.
Enumerator | |
---|---|
NeutralFeatureWeight | |
PreferFeatureWeight | |
RequireFeatureWeight | |
AvoidFeatureWeight | |
DisallowFeatureWeight |
Definition at line 46 of file qgeorouterequest.h.
Defines the amount of maneuver information that should be included with the route.
\value NoManeuvers No maneuvers should be included with the route.
\value BasicManeuvers Basic manevuers will be included with the route. This will include QGeoManeuver::instructionText().
Enumerator | |
---|---|
NoManeuvers | |
BasicManeuvers |
Definition at line 69 of file qgeorouterequest.h.
Defines the type of optimization which is applied to the planning of the route.
\value ShortestRoute Minimize the length of the journey. \value FastestRoute Minimize the traveling time for the journey. \value MostEconomicRoute Minimize the cost of the journey. \value MostScenicRoute Maximize the scenic potential of the journey.
Enumerator | |
---|---|
ShortestRoute | |
FastestRoute | |
MostEconomicRoute | |
MostScenicRoute |
Definition at line 55 of file qgeorouterequest.h.
Defines the amount of route segment information that should be included with the route.
\value NoSegmentData No segment data should be included with the route. A route requested with this level of segment detail will initialize QGeoRouteSegment::path() as a straight line between the positions of the previous and next QGeoManeuver instances.
\value BasicSegmentData Basic segment data will be included with the route. This will include QGeoRouteSegment::path().
Enumerator | |
---|---|
NoSegmentData | |
BasicSegmentData |
Definition at line 63 of file qgeorouterequest.h.
Defines modes of travel to be used for a route.
\value CarTravel The route will be optimized for someone who is driving a car. \value PedestrianTravel The route will be optimized for someone who is walking. \value BicycleTravel The route will be optimized for someone who is riding a bicycle. \value PublicTransitTravel The route will be optimized for someone who is making use of public transit. \value TruckTravel The route will be optimized for someone who is driving a truck.
Enumerator | |
---|---|
CarTravel | |
PedestrianTravel | |
BicycleTravel | |
PublicTransitTravel | |
TruckTravel |
Definition at line 23 of file qgeorouterequest.h.
|
explicit |
Constructs a request to calculate a route through the coordinates waypoints.
The route will traverse the objects of waypoints in order.
Definition at line 192 of file qgeorouterequest.cpp.
QGeoRouteRequest::QGeoRouteRequest | ( | const QGeoCoordinate & | origin, |
const QGeoCoordinate & | destination ) |
Constructs a request to calculate a route between origin and destination.
Definition at line 202 of file qgeorouterequest.cpp.
|
defaultnoexcept |
Constructs a route request object from the contents of other.
|
defaultnoexcept |
|
default |
Destroys the request.
QDateTime QGeoRouteRequest::departureTime | ( | ) | const |
Returns the departure time in the request.
Definition at line 441 of file qgeorouterequest.cpp.
QList< QGeoRectangle > QGeoRouteRequest::excludeAreas | ( | ) | const |
Returns areas the route must not cross.
Definition at line 282 of file qgeorouterequest.cpp.
QList< QGeoRouteRequest::FeatureType > QGeoRouteRequest::featureTypes | ( | ) | const |
Returns the list of features that will be considered when planning the route.
Features with a weight of NeutralFeatureWeight will not be returned.
Definition at line 359 of file qgeorouterequest.cpp.
QGeoRouteRequest::FeatureWeight QGeoRouteRequest::featureWeight | ( | QGeoRouteRequest::FeatureType | featureType | ) | const |
Returns the weight assigned to featureType in the planning of the route.
If no feature weight has been specified for featureType then NeutralFeatureWeight will be returned.
Definition at line 350 of file qgeorouterequest.cpp.
QGeoRouteRequest::ManeuverDetail QGeoRouteRequest::maneuverDetail | ( | ) | const |
Returns the level of detail which will be used in the representation of routing maneuvers.
Definition at line 417 of file qgeorouterequest.cpp.
int QGeoRouteRequest::numberAlternativeRoutes | ( | ) | const |
Returns the number of alternative routes which will be requested.
Definition at line 301 of file qgeorouterequest.cpp.
|
noexcept |
Assigns other to this route request object and then returns a reference to this route request object.
Definition at line 223 of file qgeorouterequest.cpp.
QGeoRouteRequest::RouteOptimizations QGeoRouteRequest::routeOptimization | ( | ) | const |
Returns the optimization criteria which this request specifies should be used while planning the route.
Definition at line 379 of file qgeorouterequest.cpp.
QGeoRouteRequest::SegmentDetail QGeoRouteRequest::segmentDetail | ( | ) | const |
Returns the level of detail which will be used in the representation of routing segments.
Definition at line 397 of file qgeorouterequest.cpp.
Sets the departure time departureTime for the route calculation.
This information can be used by the backend to calculate a faster route, for example, by avoiding traffic congestion during rush hour.
The default value is an invalid QDateTime.
Definition at line 431 of file qgeorouterequest.cpp.
void QGeoRouteRequest::setExcludeAreas | ( | const QList< QGeoRectangle > & | areas | ) |
Sets areas as excluded areas that the route must not cross.
Definition at line 274 of file qgeorouterequest.cpp.
void QGeoRouteRequest::setFeatureWeight | ( | QGeoRouteRequest::FeatureType | featureType, |
QGeoRouteRequest::FeatureWeight | featureWeight ) |
Assigns the weight featureWeight to the feature featureType during the planning of the route.
By default all features are assigned a weight of NeutralFeatureWeight.
It is impossible to assign a weight to QGeoRouteRequest::NoFeature.
Definition at line 334 of file qgeorouterequest.cpp.
void QGeoRouteRequest::setManeuverDetail | ( | QGeoRouteRequest::ManeuverDetail | maneuverDetail | ) |
Sets the level of detail to use when representing routing maneuvers to maneuverDetail.
The default value is QGeoRouteRequest::BasicManeuvers.
Definition at line 408 of file qgeorouterequest.cpp.
void QGeoRouteRequest::setNumberAlternativeRoutes | ( | int | alternatives | ) |
Sets the number of alternative routes to request to alternatives.
If alternatives is negative the number of alternative routes is set to 0.
The default value is 0.
Definition at line 293 of file qgeorouterequest.cpp.
void QGeoRouteRequest::setRouteOptimization | ( | RouteOptimizations | optimization | ) |
Sets the optimization criteria to use while planning the route to optimization.
The default value is QGeoRouteRequest::FastestRoute.
Definition at line 370 of file qgeorouterequest.cpp.
void QGeoRouteRequest::setSegmentDetail | ( | QGeoRouteRequest::SegmentDetail | segmentDetail | ) |
Sets the level of detail to use when representing routing segments to segmentDetail.
Definition at line 388 of file qgeorouterequest.cpp.
void QGeoRouteRequest::setTravelModes | ( | TravelModes | travelModes | ) |
Sets the travel modes which should be considered during the planning of the route to travelModes.
The default value is QGeoRouteRequest::CarTravel.
Definition at line 312 of file qgeorouterequest.cpp.
void QGeoRouteRequest::setWaypoints | ( | const QList< QGeoCoordinate > & | waypoints | ) |
Sets waypoints as the waypoints that the route should pass through.
The waypoints should be given in order from origin to destination.
This request will be invalid until the waypoints have been set to a list containing two or more coordinates.
Definition at line 258 of file qgeorouterequest.cpp.
|
inlinenoexcept |
Definition at line 86 of file qgeorouterequest.h.
QGeoRouteRequest::TravelModes QGeoRouteRequest::travelModes | ( | ) | const |
Returns the travel modes which this request specifies should be considered during the planning of the route.
Definition at line 321 of file qgeorouterequest.cpp.
QList< QGeoCoordinate > QGeoRouteRequest::waypoints | ( | ) | const |
Returns the waypoints that the route will pass through.
Definition at line 266 of file qgeorouterequest.cpp.
|
friend |
Returns whether the route requests lhs and rhs are not equal.
Definition at line 93 of file qgeorouterequest.h.
|
friend |
Returns whether the route requests lhs and rhs are equal.
Definition at line 88 of file qgeorouterequest.h.