route QML Value Type

ルートタイプは1つの地理的なルートを表します。詳細...

Import Statement: import QtLocation 6.8
Since: QtLocation 5.5

プロパティ

方法

詳細説明

ルートタイプには、ルートの長さ、ルートの推定所要時間、地図上にルートの基本的なイメージを表示するのに十分な情報など、ルートに関する高レベルの情報が含まれています。

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 のリスト内のルートのインデックスを保持します。このルートが全体のルート内のレッグでない場合、インデックスは -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参照 ください。


© 2025 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.