QPlaceResult Class

QPlaceResult クラスは、場所を含む検索結果を表します。詳細...

Header: #include <QPlaceResult>
qmake: QT += location
Inherits: QPlaceSearchResult

パブリック関数

QPlaceResult()
QPlaceResult(const QPlaceSearchResult &other)
virtual ~QPlaceResult()
qreal distance() const
bool isSponsored() const
QPlace place() const
void setDistance(qreal distance)
void setPlace(const QPlace &place)
void setSponsored(bool sponsored)

詳細説明

PlaceResult は、検索リクエストの中心からその場所までの距離、その場所のインスタンス、その結果がスポンサードサーチかオーガニックサーチかを示す情報を保持します。

QPlaceSearchResult 、QPlaceResultに変換されます:

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::QPlaceResult()

新しい場所結果オブジェクトを構築します。

QPlaceResult::QPlaceResult(const QPlaceSearchResult &other)

可能であればother のコピーを作成し、そうでなければデフォルトのプレース結果を作成する。

[virtual noexcept] QPlaceResult::~QPlaceResult()

破壊者。

qreal QPlaceResult::distance() const

検索中心からの距離を返す。このフィールドは、検索要求が検索中心のある検索エリアを含んでいる場合にのみ関連する。そうでない場合、距離は未定義であることを示す NaN となる。距離のデフォルト値は NaN である。

setDistance()も参照のこと

bool QPlaceResult::isSponsored() const

結果がスポンサー付きであれば真を返す。

setSponsored()も参照

QPlace QPlaceResult::place() const

検索結果の場所を返す。

setPlace()も参照

void QPlaceResult::setDistance(qreal distance)

検索センターからの検索結果の場所のdistance を設定する。

distance()も参照

void QPlaceResult::setPlace(const QPlace &place)

この結果が参照するplace を設定する。

place()も参照

void QPlaceResult::setSponsored(bool sponsored)

結果がsponsored の結果であるかどうかを設定する。

isSponsored()も参照のこと

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