Skip To Content ArcGIS for Developers Sign In Dashboard

DirectionManeuverListModel Class

(Esri::ArcGISRuntime::DirectionManeuverListModel)

A list model storing a list of DirectionManeuver for a Route. More...

Header: #include <DirectionManeuverListModel>
Since: Esri::ArcGISRuntime 100.0
Inherits: QAbstractListModel

Public Types

enum DirectionManeuverRoles { DirectionManeuverTypeRole, DirectionTextRole, DurationRole, EstimatedArrivalTimeRole, ..., LengthRole }

Public Functions

~DirectionManeuverListModel()
QList<DirectionManeuver> directionManeuvers() const

Reimplemented Public Functions

virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const

Additional Inherited Members

Detailed Description

A list model storing a list of DirectionManeuver for a Route.

Direction maneuvers give you a step-by-step explanation of how you would get from one location to another along a transportation network. Each direction maneuver contains information such as the description of what you should do (e.g. "Turn right on Main St"), the duration of that maneuver (e.g. 2 minutes), and the local arrival time. DirectionManeuverListModel is meant to simplify the workflow of obtaining direction maneuvers from a RouteResult, and populating the resulting information into a view. For example, you may want to get all of your route's direction maneuvers and display them in a list view for a user to scroll through. Since each direction maneuver contains geometry, you can zoom to each direction maneuver on the map as the user clicks on the different items in the list.

The model returns data for the following roles:

RoleTypeDescriptionDirectionManeuverRoles
directionManeuverTypeDirectionManeuverTypeThe type of direction maneuver.DirectionManeuverTypeRole
directionTextQStringThe step-by-step directions of the maneuver.DirectionTextRole
durationdoubleThe duration of the maneuver in minutes.DurationRole
estimatedArrivalTimeQDateTimeThe estimated arrival time in UTC time.EstimatedArrivalTimeRole
estimatedArrivalTimeShiftdoubleThe time zone shift in minutes of the estimated arrival time.EstimatedArrivalTimeShiftRole
geometryGeometryThe geometry of the maneuver, typically a Polyline or a Point.GeometryRole
lengthdoubleThe length of the maneuver in meters.LengthRole

See also RouteTask, Route, RouteResult, and DirectionManeuver.

Member Type Documentation

enum DirectionManeuverListModel::DirectionManeuverRoles

This enum specifies the custom roles which can be used with DirectionManeuverListModel::data.

ConstantValueDescription
Esri::ArcGISRuntime::DirectionManeuverListModel::DirectionManeuverTypeRoleQt::UserRole + 1The type of direction maneuver.
Esri::ArcGISRuntime::DirectionManeuverListModel::DirectionTextRoleQt::UserRole + 2The step-by-step directions of the maneuver.
Esri::ArcGISRuntime::DirectionManeuverListModel::DurationRoleQt::UserRole + 3The duration of the maneuver in minutes.
Esri::ArcGISRuntime::DirectionManeuverListModel::EstimatedArrivalTimeRoleQt::UserRole + 4The estimated arrival time in UTC time.
Esri::ArcGISRuntime::DirectionManeuverListModel::EstimatedArrivalTimeShiftRoleQt::UserRole + 5The time zone shift in minutes of the estimated arrival time.
Esri::ArcGISRuntime::DirectionManeuverListModel::GeometryRoleQt::UserRole + 6The geometry of the maneuver, typically a Polyline or a Point.
Esri::ArcGISRuntime::DirectionManeuverListModel::LengthRoleQt::UserRole + 7The length of the maneuver in meters.

Member Function Documentation

DirectionManeuverListModel::~DirectionManeuverListModel()

Destructor.

[virtual] QVariant DirectionManeuverListModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const

Reimplemented from QAbstractItemModel::data().

Returns the data stored under the given role for the maneuver referred to by the index.

  • index. The index in the model for which to return data.
  • role. The role for which to return data.

QList<DirectionManeuver> DirectionManeuverListModel::directionManeuvers() const

Returns the list of DirectionManeuver contained in the list model.

Use this to directly obtain the list of DirectionManeuver objects, as opposed to hooking up the list model to a view.


Feedback on this topic?