QPlaceSearchResult Class
QPlaceSearchResult 클래스는 검색 결과의 기본 클래스입니다. 더 보기...
| Header: | #include <QPlaceSearchResult> |
| qmake: | QT += location |
| Inherited By: |
공개 유형
| 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 에서 요청이 성공적으로 완료된 후 검색 결과 목록을 가져올 수 있습니다. 모든 검색 결과에 공통적으로 포함된 title 및 icon 는 사용자에게 검색 결과를 표시하는 데 사용할 수 있습니다.
의도된 사용 방법은 type 에 따라 검색 결과를 다음과 같이 더 상세한 하위 클래스로 변환하는 것입니다:
if (result.type()== QPlaceSearchResult::PlaceResult) {
QPlaceResult placeResult = result;
qDebug() << placeResult.place().name();
qDebug() << placeResult.place().location().coordinate();
qDebug() << placeResult.distance();
}이 구현은 객체 슬라이싱이 문제가 되지 않도록 처리됩니다. 클라이언트 애플리케이션이나 백엔드 플러그인이 QPlaceSearchResult를 직접 인스턴스화하는 것은 예상되지 않으며, 대신 클라이언트 애플리케이션은 단순히 검색 결과 하위 클래스로 변환하고, 백엔드 플러그인은 하위 클래스만 인스턴스화합니다.
QPlaceResult도 참조하십시오 .
멤버 유형 문서
enum QPlaceSearchResult::SearchResultType
검색 결과의 유형을 정의합니다
| 상수 | 값 | 설명 |
|---|---|---|
QPlaceSearchResult::UnknownSearchResult | 0 | 검색 결과의 내용이 알려지지 않았습니다. |
QPlaceSearchResult::PlaceResult | 1 | 검색 결과에 장소가 포함되어 있습니다. |
QPlaceSearchResult::ProposedSearchResult | 2 | 검색 결과에 관련성이 있을 수 있는 제안된 검색이 포함되어 있습니다. |
멤버 함수 설명
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 가 이 검색 결과와 일치하지 않으면 true를 반환하고, 그렇지 않으면 false를 반환합니다.
QPlaceSearchResult &QPlaceSearchResult::operator=(const QPlaceSearchResult &other)
이 검색 결과에 ` other `를 할당하고, 이 검색 결과에 대한 참조를 반환합니다.
bool QPlaceSearchResult::operator==(const QPlaceSearchResult &other) const
other 가 이 검색 결과와 일치하면 true를 반환하고, 그렇지 않으면 false를 반환합니다.
© 2026 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.