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 | 要求された操作または操作のオプションの1つが、サービスプロバイダによってサポートされていません。 |
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
操作が正常に完了した場合、または操作が停止するようなエラーが発生した場合に真を返す。
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()も参照のこと 。
© 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.