QPlaceSearchResult Class

QPlaceSearchResultクラスは検索結果の基本クラスです。詳細...

Header: #include <QPlaceSearchResult>
qmake: QT += location
Inherited By:

QPlaceProposedSearchResult and QPlaceResult

パブリックタイプ

enum SearchResultType { UnknownSearchResult, PlaceResult, ProposedSearchResult }

パブリック関数

QPlaceSearchResult()
QPlaceSearchResult(const QPlaceSearchResult &other)
virtual ~QPlaceSearchResult()
QPlaceIcon icon() const
void setIcon(const QPlaceIcon &icon)
void setTitle(const QString &title)
QString title() const
QPlaceSearchResult::SearchResultType type() const
bool operator!=(const QPlaceSearchResult &other) const
QPlaceSearchResult &operator=(const QPlaceSearchResult &other)
bool operator==(const QPlaceSearchResult &other) const

詳細説明

検索結果のリストは、リクエストが正常に完了した後にQPlaceSearchReply から取得することができる。すべての検索結果に共通するのは、titleicon 、検索結果をユーザーに提示するために使用できる。

type に応じて、検索結果をより詳細なサブクラスに変換することができます:

if(result.type()==QPlaceSearchResult::PlaceResult) { if (result.type() == placeResult)    QPlaceResultplaceResult=result;    qDebug() << placeResult.place().name();
    qDebug() << placeResult.place().location().coordinate();
    qDebug() << placeResult.distance();
}

この実装は、オブジェクトのスライスが問題にならないように処理される。クライアントアプリケーションやバックエンドプラグインがQPlaceSearchResultを直接インスタンス化することは期待されておらず、むしろクライアントアプリケーションは単に検索結果のサブクラスに変換し、バックエンドプラグインはサブクラスをインスタンス化するだけです。

QPlaceResultも参照してください

メンバ型ドキュメント

enum QPlaceSearchResult::SearchResultType

検索結果のタイプを定義します。

定数説明
QPlaceSearchResult::UnknownSearchResult0検索結果の内容は不明。
QPlaceSearchResult::PlaceResult1検索結果は場所を含む。
QPlaceSearchResult::ProposedSearchResult2検索結果には、関連する可能性のある検索候補が含まれています。

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

QPlaceSearchResult::QPlaceSearchResult()

新しい検索結果を作成します。

QPlaceSearchResult::QPlaceSearchResult(const QPlaceSearchResult &other)

のコピーを作成する。other

[virtual noexcept] QPlaceSearchResult::~QPlaceSearchResult()

検索結果を破棄する。

QPlaceIcon QPlaceSearchResult::icon() const

検索結果を表すアイコンを返します。

setIcon()も参照ください

void QPlaceSearchResult::setIcon(const QPlaceIcon &icon)

検索結果のアイコンをicon に設定する。

icon()も参照

void QPlaceSearchResult::setTitle(const QString &title)

検索結果のタイトルをtitle に設定する。

title()も参照のこと

QString QPlaceSearchResult::title() const

検索結果のタイトルを返します。この文字列は、検索結果をユーザーに表示する際に使用します。

setTitle()も参照

QPlaceSearchResult::SearchResultType QPlaceSearchResult::type() const

結果の型を返します。

bool QPlaceSearchResult::operator!=(const QPlaceSearchResult &other) const

other がこの検索結果と等しくなければ真を返し、そうでなければ偽を返す。

QPlaceSearchResult &QPlaceSearchResult::operator=(const QPlaceSearchResult &other)

この検索結果にother を割り当て、この検索結果への参照を返す。

bool QPlaceSearchResult::operator==(const QPlaceSearchResult &other) const

other がこの検索結果と等しければ真を返し、そうでなければ偽を返す。

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