RouteThe Route element represents one geographical route. More... Inherits QtObject This type was introduced in Qt Location 5.0. Properties
Detailed DescriptionA Route element 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 RouteSegment elements which describe subsections of the route in greater detail. The primary means of acquiring Route elements is RouteModel. ExampleThis example shows how to display a route's maneuvers in a ListView: import QtQuick 2.0 import QtLocation 5.0 RouteModel { id: routeModel // model initialization } ListView { spacing: 10 model: routeModel.status == RouteModel.Ready ? routeModel.get(0).segments : null visible: model ? true : false delegate: Row { width: parent.width spacing: 10 property bool hasManeuver : modelData.maneuver && modelData.maneuver.valid visible: hasManeuver Text { text: (1 + index) + "." } Text { text: hasManeuver ? modelData.maneuver.instructionText : "" } } } Property DocumentationRead-only property which holds a bounding box which encompasses the entire route. Read-only property which holds distance covered by this route, in meters. 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 elements and 'path[index starting from zero]' gives the actual element. See also Coordinate. Read-only property which holds the list of RouteSegment elements of this route. To access individual segments you can use standard list accessors: 'segments.length' indicates the number of elements and 'segments[index starting from zero]' gives the actual element. See also RouteSegment. Read-only property which holds the estimated amount of time it will take to traverse this route, in seconds. |