routeSegment QML Type
routeSegment 型は、Route のセグメントを表します。詳細...
| Import Statement: | import QtLocation 6.12 |
| Since: | QtLocation 5.5 |
プロパティ
- distance : real
- maneuver : RouteManeuver
- path : list<coordinate>
- travelTime : int
詳細な説明
routeSegmentインスタンスには、ルートセグメントの物理的な配置、ルートの長さ、ルートセグメントを通過するのに要する推定時間、およびルートセグメントの終端に関連付けられたオプションのrouteManeuverに関する情報が含まれます。
routeSegment のインスタンスは、ルーティンググラフ上の辺とみなすことができ、routeManeuver のインスタンスは、グラフの頂点に付随するオプションのラベルとみなすことができます。
Route オブジェクトを取得する主な手段は、RouteModel を経由した Routes を通じて行うことです。
例
以下の QML スニペットは、ルートセグメントに関する情報を出力する方法を示しています:
import QtQuick
import QtPositioning
import QtLocation
Text {
text: "Segment distance " + routeSegment.distance + " meters, " + routeSegment.path.length + " points."
}プロパティのドキュメント
distance : real
このルート区間が通過した距離(メートル単位)を格納する読み取り専用プロパティです。
maneuver : RouteManeuver
このルートセグメントの機動情報を保持する読み取り専用プロパティ。
このルート区間の終点に情報が紐付けられていない場合、無効なマニューバが返されます。
path : list<coordinate>
この区間の地理座標を保持する読み取り専用プロパティです。座標は、この区間を移動する人が通る順序で列挙されます。
個々のセグメントにアクセスするには、標準的なリストアクセサを使用できます。「path.length」はオブジェクトの数を示し、「path[0から始まるインデックス]」は実際のオブジェクトを取得します。
QtPositioning::coordinateも参照してください 。
travelTime : int
このセグメントを通過するのにかかる推定時間を秒単位で保持する読み取り専用プロパティです。
© 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.