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) { QPlaceResult placeResult = 결과;    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

결과가 스폰서 결과인 경우 true를 반환합니다.

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.