- Qt 6.8
- Qt Location
- QML Types
- routeSegment
- Qt 6.8.0 Reference Documentation

# routeSegment QML Type

The routeSegment type represents a segment of a Route. More...

Import Statement: | import QtLocation 6.8
Since: | QtLocation 5.5

- List of all members, including inherited members

## Properties

- distance : real
- maneuver : RouteManeuver
- path : list<coordinate>
- travelTime : int

## Detailed Description

A routeSegment instance has information about the physical layout of the route segment, the length of the route and estimated time required to traverse the route segment and optional routeManeuvers associated with the end of the route segment.

Instances of routeSegment can be thought of as edges on a routing graph, with routeManeuver instances as optional labels attached to the vertices of the graph.

The primary means of acquiring Route objects is via Routes via RouteModel.

## Example

The following QML snippet demonstrates how to print information about a route segment:

     import QtQuick
     import QtPositioning
     import QtLocation

     Text {
         text: "Segment distance " + routeSegment.distance + " meters, " + routeSegment.path.length + " points."
     }

## Property Documentation

distance : real

Read-only property which holds the distance covered by this segment of the route, in meters.

maneuver : RouteManeuver

Read-only property which holds the maneuver for this route segment.

Will return invalid maneuver if no information has been attached to the endpoint of this route segment.

path : list<coordinate>

Read-only property which holds the geographical coordinates of this segment. 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.

See also QtPositioning::coordinate.

travelTime : int

Read-only property which holds the estimated amount of time it will take to traverse this segment, in seconds.