このページでは

QGeoRoute Class

QGeoRoute クラスは、2つの地点間の経路を表します。詳細...

Header: #include <QGeoRoute>
qmake: QT += location

プロパティ

パブリック関数

QGeoRoute()
QGeoRoute(const QGeoRoute &other)
QGeoRoute(QGeoRoute &&other)
~QGeoRoute()
QGeoRectangle bounds() const
qreal distance() const
QVariantMap extendedAttributes() const
QGeoRouteSegment firstRouteSegment() const
int legIndex() const
QGeoRoute overallRoute() const
QList<QGeoCoordinate> path() const
QString routeId() const
QList<QGeoRoute> routeLegs() const
QList<QGeoRouteSegment> segments() const
qsizetype segmentsCount() const
void setFirstRouteSegment(const QGeoRouteSegment &routeSegment)
void setPath(const QList<QGeoCoordinate> &path)
void setTravelMode(QGeoRouteRequest::TravelMode mode)
QGeoRouteRequest::TravelMode travelMode() const
int travelTime() const
QGeoRoute &operator=(const QGeoRoute &other)

保護された関数

QExplicitlySharedDataPointer<QGeoRoutePrivate> &d()
bool operator!=(const QGeoRoute &lhs, const QGeoRoute &rhs)
bool operator==(const QGeoRoute &lhs, const QGeoRoute &rhs)

詳細な説明

QGeoRoute オブジェクトには、ルートの長さや推定所要時間、地図上にルートの基本的なイメージを描画するのに十分な情報など、ルートに関する概要情報が含まれています。

また、QGeoRoute オブジェクトには、ルートの各区間をより詳細に記述するQGeoRouteSegment オブジェクトのリストも含まれています。

通常、経路情報は `QGeoRoutingManager::calculateRoute()` を使用して要求され、これにより `QGeoRouteReply ` インスタンスが返されます。操作が正常に完了した場合、`QGeoRouteReply::routes()` を使用して経路情報にアクセスできます。

QGeoRoutingManagerも参照してください 。

プロパティのドキュメント

[read-only] bounds : const QGeoRectangle

このプロパティには、ルート全体を囲むバウンディングボックスが格納されます

アクセス関数:

QGeoRectangle bounds() const

[read-only] distance : const qreal

このプロパティには、このルートで移動した距離(メートル単位)が格納されます

アクセス関数:

qreal distance() const

[read-only] extendedAttributes : const QVariantMap

このプロパティには、このルートに関連付けられた拡張属性が格納されています

アクセス関数:

QVariantMap extendedAttributes() const

[read-only] legIndex : const int

このプロパティには、このルートのレッグインデックスが格納されています

このルートを含むQGeoRoute::routeLegs リスト内の区間のインデックスを使用することで、次の区間を特定できます。

アクセス関数:

int legIndex() const

[read-only] overallRoute : const QGeoRoute

このプロパティには、このルート区間を含むルートが格納されます

このルートが、全体的なルート内の区間ではない場合、このプロパティには空のルートが格納されます。

アクセス関数:

QGeoRoute overallRoute() const

path : QList<QGeoCoordinate>

このプロパティには、ルートの幾何学的形状が格納されます

座標は、このルートの区間を移動する人が実際に通る順序で列挙する必要があります。

アクセス関数:

QList<QGeoCoordinate> path() const
void setPath(const QList<QGeoCoordinate> &path)

[read-only] routeId : const QString

このプロパティには、このルートの識別子が格納されます

ルートの更新をサポートするサービスプロバイダーは、通常、ルートに識別子を割り当てています。このルートがそのようなサービスプロバイダーから提供されたものである場合、識別子を変更すると、ルートの更新が機能しなくなる可能性があります。

アクセス関数:

QString routeId() const

[read-only] routeLegs : const QList<QGeoRoute>

このプロパティは、複数ウェイポイントを含むルート「legs 」を保持しています

アクセス関数:

QList<QGeoRoute> routeLegs() const

[read-only] segments : const QList<QGeoRouteSegment>

このプロパティには、このルートのQGeoRouteSegment オブジェクトのリストが格納されています

アクセス関数:

QList<QGeoRouteSegment> segments() const

[read-only] segmentsCount : const qsizetype

このプロパティには、ルートに含まれるセグメント数が格納されます

アクセス関数:

qsizetype segmentsCount() const

[read-only] travelTime : const int

このプロパティには、このルートを移動するのにかかる推定時間が秒単位で格納されています

アクセス関数:

int travelTime() const

メンバ関数のドキュメント

QGeoRoute::QGeoRoute()

ルートオブジェクトを作成します。

[noexcept] QGeoRoute::QGeoRoute(const QGeoRoute &other)

other の内容からルートオブジェクトを作成します。

[constexpr noexcept default] QGeoRoute::QGeoRoute(QGeoRoute &&other)

QGeoRoute のインスタンスをMoveコンストラクタで生成します。

[noexcept] QGeoRoute::~QGeoRoute()

このルートオブジェクトを破棄します。

[protected] QExplicitlySharedDataPointer<QGeoRoutePrivate> &QGeoRoute::d()

非公開の実装を返します。

QGeoRouteSegment QGeoRoute::firstRouteSegment() const

ルート内の最初のルートセグメントを返します。

そのルートに関連付けられたルートセグメントが存在しない場合、無効なルートセグメントが返されます。

残りのルートセグメントには、QGeoRouteSegment::nextRouteSegment を使用して順次アクセスできます。

setFirstRouteSegment()も参照してください 。

void QGeoRoute::setFirstRouteSegment(const QGeoRouteSegment &routeSegment)

ルートの最初のルートセグメントをrouteSegment に設定します。

firstRouteSegment()も参照してください 。

void QGeoRoute::setTravelMode(QGeoRouteRequest::TravelMode mode)

このルートの移動モードを「mode 」に設定します。

これは、request().travelModes() によって返される移動モードのいずれかである必要があります。

travelMode()も参照してください 。

QGeoRouteRequest::TravelMode QGeoRoute::travelMode() const

このルートの移動モードを返します。

これは、request().travelModes() によって返される移動モードのいずれかである必要があります。

setTravelMode()も参照してください 。

[noexcept] QGeoRoute &QGeoRoute::operator=(const QGeoRoute &other)

other の内容をこのルートに割り当て、このルートへの参照を返します。

関連する非メンバー

[noexcept] bool operator!=(const QGeoRoute &lhs, const QGeoRoute &rhs)

ルート「lhs 」と「rhs 」が等しくないかどうかを返します。

[noexcept] bool operator==(const QGeoRoute &lhs, const QGeoRoute &rhs)

ルート `lhs ` と `rhs ` が等しいかどうかを返します。

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