QGeoRouteReply Class
QGeoRouteReply クラスは、QGeoRoutingManager のインスタンスによって開始された操作を管理します。詳細...
| Header: | #include <QGeoRouteReply> |
| qmake: | QT += location |
| Inherits: | QObject |
パブリック型
| enum | Error { NoError, EngineNotSetError, CommunicationError, ParseError, UnsupportedOptionError, UnknownError } |
パブリック関数
| QGeoRouteReply(QGeoRouteReply::Error error, const QString &errorString, QObject *parent = nullptr) | |
| virtual | ~QGeoRouteReply() |
| virtual void | abort() |
| QGeoRouteReply::Error | error() const |
| QString | errorString() const |
| bool | isFinished() const |
| QGeoRouteRequest | request() const |
| QList<QGeoRoute> | routes() const |
シグナル
| void | aborted() |
| void | errorOccurred(QGeoRouteReply::Error error, const QString &errorString = QString()) |
| void | finished() |
保護された関数
| QGeoRouteReply(const QGeoRouteRequest &request, QObject *parent = nullptr) | |
| void | addRoutes(const QList<QGeoRoute> &routes) |
| void | setError(QGeoRouteReply::Error error, const QString &errorString) |
| void | setFinished(bool finished) |
| void | setRoutes(const QList<QGeoRoute> &routes) |
詳細な説明
QGeoRouteReply のインスタンスは、これらの操作の状態と結果を管理します。
isFinished()、error()、およびerrorString() メソッドは、操作が完了したかどうか、および正常に完了したかどうかに関する情報を提供します。
finished()、errorOccurred(QGeoRouteReply::Error,QString) 信号は、操作の進行状況を監視するために使用できます。
新しく作成された QGeoRouteReply が「完了」状態になっている可能性があります。これは、ほとんどの場合、エラーが発生したことが原因です。このようなインスタンスは、finished() やerrorOccurred(QGeoRouteReply::Error,QString) シグナルを絶対に発信しないため、シグナルへの接続を行う前に、isFinished() の結果を確認することが重要です。QGeoRoutingManager のドキュメントでは、その実施方法が示されています。
操作が正常に完了した場合、結果は `routes()` を使用して取得できます。
メンバ型のドキュメント
enum QGeoRouteReply::Error
操作の完了を妨げたエラーについて説明します。
| 定数 | 値 | 説明 |
|---|---|---|
QGeoRouteReply::NoError | 0 | エラーは発生していません。 |
QGeoRouteReply::EngineNotSetError | 1 | 使用されたルーティング・マネージャーに、QGeoRoutingManagerEngine インスタンスが関連付けられていませんでした。 |
QGeoRouteReply::CommunicationError | 2 | サービスプロバイダとの通信中にエラーが発生しました。 |
QGeoRouteReply::ParseError | 3 | サービス プロバイダーからの応答の形式が認識できませんでした。 |
QGeoRouteReply::UnsupportedOptionError | 4 | 要求された操作、またはその操作のオプションのいずれかが、サービスプロバイダによってサポートされていません。 |
QGeoRouteReply::UnknownError | 5 | 他のどのカテゴリにも該当しないエラーが発生しました。 |
メンバ関数のドキュメント
[explicit protected] QGeoRouteReply::QGeoRouteReply(const QGeoRouteRequest &request, QObject *parent = nullptr)
request に基づいて、指定されたparent を含むルート応答オブジェクトを作成します。
[explicit] QGeoRouteReply::QGeoRouteReply(QGeoRouteReply::Error error, const QString &errorString, QObject *parent = nullptr)
指定されたerror およびerrorString 、ならびに指定されたparent を用いて、ルート応答を生成します。
[virtual noexcept] QGeoRouteReply::~QGeoRouteReply()
このルート応答オブジェクトを破棄します。
[virtual] void QGeoRouteReply::abort()
操作を直ちに中止します。
応答が完了している場合は、何もしません。
[signal] void QGeoRouteReply::aborted()
このシグナルは、操作がキャンセルされたときに発行されます。
abort()も参照してください 。
[protected] void QGeoRouteReply::addRoutes(const QList<QGeoRoute> &routes)
routes のリストを既存のリストに追加します。
QGeoRouteReply::Error QGeoRouteReply::error() const
この応答のエラー状態を返します。
結果が `QGeoRouteReply::NoError ` の場合は、エラーは発生していません。
setError()も参照してください 。
[signal] void QGeoRouteReply::errorOccurred(QGeoRouteReply::Error error, const QString &errorString = QString())
このシグナルは、この応答の処理中にエラーが検出された場合に発信されます。その後、finished() シグナルが発信される可能性があります。
エラーは、エラーコード `error` によって記述されます。`errorString ` が空でない場合、そこにはエラーの説明文が含まれます。
このシグナルとQGeoRoutingManager::errorOccurred()は同時に発火します。
注: このシグナルに接続されたスロット内で、この返信オブジェクトを削除しないでください 。代わりにdeleteLater() を使用してください。
QString QGeoRouteReply::errorString() const
この応答のエラー状態を文字列として返します。
エラーが発生していない場合、空の文字列が返されます。テキスト表現が割り当てられていないエラーが発生した可能性もあり、その場合も空の文字列が返されます。
エラーが発生したかどうかを確認するには、QGeoRouteReply::error() の値がQGeoRouteReply::NoError と等しいかどうかを確認してください。
[signal] void QGeoRouteReply::finished()
この応答の処理が完了すると、このシグナルが発信されます。
error() の値がQGeoRouteReply::NoError と等しい場合、処理は正常に完了しました。
このシグナルとQGeoRoutingManager::finished()は同時に発火します。
注: このシグナルに接続されたスロット内で、この返信オブジェクトを削除しないでください 。代わりに、deleteLater() を使用してください。
setFinished()も参照してください 。
bool QGeoRouteReply::isFinished() const
操作が正常に完了した場合、または操作が中断される原因となるエラーが発生した場合は、true を返します。
QGeoRouteRequest QGeoRouteReply::request() const
そのルートを指定したルートリクエストを返します。
QList<QGeoRoute> QGeoRouteReply::routes() const
リクエストされたルートのリストを返します。
setRoutes()も参照してください 。
[protected] void QGeoRouteReply::setError(QGeoRouteReply::Error error, const QString &errorString)
この応答のエラー状態を「error 」に設定し、エラーのテキスト表現を「errorString 」に設定します。
これにより、errorOccurred() およびfinished() シグナルが、その順序で発火します。
error()も参照してください 。
[protected] void QGeoRouteReply::setFinished(bool finished)
finished に対して、この応答が完了したかどうかを設定します。
finished がtrueの場合、これによりfinished()シグナルが発信されます。
操作が正常に完了した場合は、この関数を呼び出す前にQGeoRouteReply::setRoutes() を呼び出す必要があります。エラーが発生した場合は、代わりにQGeoRouteReply::setError() を使用してください。
finished()も参照してください 。
[protected] void QGeoRouteReply::setRoutes(const QList<QGeoRoute> &routes)
routes への応答に含まれるルートのリストを設定します。
routes()も参照してください 。
© 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.