QGeoRouteRequest Class

The QGeoRouteRequest class represents the parameters and restrictions which define a request for routing information. More...

Header: #include <QGeoRouteRequest>
qmake: QT += location
Since: Qt 5.6

This class was introduced in Qt 5.6.

Public Types

enum FeatureType { NoFeature, TollFeature, HighwayFeature, PublicTransitFeature, FerryFeature, …, TrafficFeature }
enum FeatureWeight { NeutralFeatureWeight, PreferFeatureWeight, RequireFeatureWeight, AvoidFeatureWeight, DisallowFeatureWeight }
enum ManeuverDetail { NoManeuvers, BasicManeuvers }
enum RouteOptimization { ShortestRoute, FastestRoute, MostEconomicRoute, MostScenicRoute }
enum SegmentDetail { NoSegmentData, BasicSegmentData }
enum TravelMode { CarTravel, PedestrianTravel, BicycleTravel, PublicTransitTravel, TruckTravel }

Detailed Description

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.

See also QGeoRoutingManager.

Member Type Documentation

enum QGeoRouteRequest::FeatureType

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.

ConstantValueDescription
QGeoRouteRequest::NoFeature0x00000000Used by QGeoRoutingManager::supportedFeatureTypes() to indicate that no features will be taken into account when planning the route.
QGeoRouteRequest::TollFeature0x00000001Consdier tollways when planning the route.
QGeoRouteRequest::HighwayFeature0x00000002Consider highways when planning the route.
QGeoRouteRequest::PublicTransitFeature0x00000004Consider public transit when planning the route.
QGeoRouteRequest::FerryFeature0x00000008Consider ferries when planning the route.
QGeoRouteRequest::TunnelFeature0x00000010Consider tunnels when planning the route.
QGeoRouteRequest::DirtRoadFeature0x00000020Consider dirt roads when planning the route.
QGeoRouteRequest::ParksFeature0x00000040Consider parks when planning the route.
QGeoRouteRequest::MotorPoolLaneFeature0x00000080Consider motor pool lanes when planning the route.
QGeoRouteRequest::TrafficFeature0x00000100Consider the current traffic situation when planning the route. Since QtLocation 5.10

enum QGeoRouteRequest::FeatureWeight

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.

ConstantValueDescription
QGeoRouteRequest::NeutralFeatureWeight0x00000000The presence or absence of the feature will not affect the planning of the route.
QGeoRouteRequest::PreferFeatureWeight0x00000001Routes which contain the feature will be preferred over those that do not.
QGeoRouteRequest::RequireFeatureWeight0x00000002Only routes which contain the feature will be considered, otherwise no route will be returned.
QGeoRouteRequest::AvoidFeatureWeight0x00000004Routes which do not contain the feature will be preferred over those that do.
QGeoRouteRequest::DisallowFeatureWeight0x00000008Only routes which do not contain the feature will be considered, otherwise no route will be returned.

enum QGeoRouteRequest::ManeuverDetail

Defines the amount of maneuver information that should be included with the route.

ConstantValueDescription
QGeoRouteRequest::NoManeuvers0x0000No maneuvers should be included with the route.
QGeoRouteRequest::BasicManeuvers0x0001Basic manevuers will be included with the route. This will include QGeoManeuver::instructionText().

enum QGeoRouteRequest::RouteOptimization

Defines the type of optimization which is applied to the planning of the route.

ConstantValueDescription
QGeoRouteRequest::ShortestRoute0x0001Minimize the length of the journey.
QGeoRouteRequest::FastestRoute0x0002Minimize the traveling time for the journey.
QGeoRouteRequest::MostEconomicRoute0x0004Minimize the cost of the journey.
QGeoRouteRequest::MostScenicRoute0x0008Maximize the scenic potential of the journey.

enum QGeoRouteRequest::SegmentDetail

Defines the amount of route segment information that should be included with the route.

ConstantValueDescription
QGeoRouteRequest::NoSegmentData0x0000No 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.
QGeoRouteRequest::BasicSegmentData0x0001Basic segment data will be included with the route. This will include QGeoRouteSegment::path().

enum QGeoRouteRequest::TravelMode

Defines modes of travel to be used for a route.

ConstantValueDescription
QGeoRouteRequest::CarTravel0x0001The route will be optimized for someone who is driving a car.
QGeoRouteRequest::PedestrianTravel0x0002The route will be optimized for someone who is walking.
QGeoRouteRequest::BicycleTravel0x0004The route will be optimized for someone who is riding a bicycle.
QGeoRouteRequest::PublicTransitTravel0x0008The route will be optimized for someone who is making use of public transit.
QGeoRouteRequest::TruckTravel0x0010The route will be optimized for someone who is driving a truck.