route QML Value Type
ルートタイプは1つの地理的なルートを表します。詳細...
| Import Statement: | import QtLocation 6.11 |
| Since: | QtLocation 5.5 |
プロパティ
- bounds : geoRectangle
- distance : real
- extendedAttributes : Object
(since QtLocation 5.13) - legIndex : int
- legs : list<route>
(since QtLocation 5.12) - overallRoute : Route
- path : list<coordinate>
- segments : list<routeSegment>
- travelTime : int
方法
- int segmentsCount()
詳細説明
ルートタイプには、ルートの長さ、ルートの推定所要時間、地図上にルートの基本的なイメージを表示するのに十分な情報など、ルートに関する高レベルの情報が含まれています。
QGeoRoute オブジェクトはまた、より詳細にルートのサブセクションを記述するrouteSegment オブジェクトのリストを含んでいます。
ルートオブジェクトを取得する主な手段はRouteModel です。
例
この例では、ListView にルートの操作を表示する方法を示します:
import QtQuick import QtPositioning import QtLocation RouteModel { id: routeModel // model initialization } ListView { id: listview anchors.fill: parent 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 : "" } } }
プロパティの説明
bounds : geoRectangle
ルート全体を囲むバウンディングボックスを保持する読み取り専用プロパティ。
distance : real
このルートがカバーする距離をメートル単位で保持する読み取り専用プロパティ。
extendedAttributes : Object [since QtLocation 5.13]
このプロパティはルートの拡張属性を保持し、マップです。これらの属性はプラグイン固有のもので、空でもかまいません。
どのような属性がサポートされ、どのように使用されるべきかについては、プラグインのドキュメントを参照してください。
QQmlPropertyMap の制限により、QML で属性を宣言的に指定することはできません。
このプロパティは QtLocation 5.13 で導入されました。
legIndex : int
読み込み専用のプロパティで、QtLocation::route::legs のリストに含まれるルートの leg のインデックスを保持します。このルートがルート全体の中のレッグでない場合、インデックスは -1 です。
overallRouteも参照してください 。
legs : list<route> [since QtLocation 5.12]
このルートに関連付けられているルートレッグを返します。ルートレッグとは、隣接する2つのウェイポイント間のサブルートのことです。この詳細レベルがバックエンドでサポートされていない場合、結果は空になることがあります。
このプロパティは QtLocation 5.12 で導入されました。
overallRoute : Route
このレッグを含むルートを保持する読み取り専用プロパティ。
path : list<coordinate>
このルートの地理座標を保持する読み取り専用のプロパティです。座標は、ルートのこの区間を旅行する人が通過する順番に並べられます。
個々のセグメントにアクセスするには、標準のリストアクセサを使用します:path.length' はオブジェクトの数を表し、 'path[index starting from zero]' は実際のオブジェクトを表します。
QtPositioning::coordinateも参照してください 。
segments : list<routeSegment>
このルートのrouteSegment オブジェクトのリストを保持する読み込み専用プロパティ。
個々のセグメントにアクセスするには、標準的なリストアクセサを使用します:segments.length' はオブジェクトの数を表し、 'segments[index starting from zero]' は実際のオブジェクトを表します。
routeSegmentも参照ください 。
travelTime : int
このルートを横断するのにかかる推定時間を秒単位で保持する読み取り専用プロパティ。
メソッドのドキュメント
int segmentsCount()
ルートのセグメント数を返します。
routeSegmentも参照ください 。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.