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