QPlaceSearchRequest Class
QPlaceSearchRequest 클래스는 검색 요청에 대한 매개변수 집합을 나타냅니다. 더 보기...
| Header: | #include <QPlaceSearchRequest> |
| qmake: | QT += location |
공개 유형
| enum | RelevanceHint { UnspecifiedHint, DistanceHint, LexicalPlaceNameHint } |
공개 함수
| QPlaceSearchRequest() | |
| QPlaceSearchRequest(const QPlaceSearchRequest &other) | |
| QPlaceSearchRequest(QPlaceSearchRequest &&other) | |
| ~QPlaceSearchRequest() | |
| QList<QPlaceCategory> | categories() const |
| void | clear() |
| int | limit() const |
| QString | recommendationId() const |
| QPlaceSearchRequest::RelevanceHint | relevanceHint() const |
| QGeoShape | searchArea() const |
| QVariant | searchContext() const |
| QString | searchTerm() const |
| void | setCategories(const QList<QPlaceCategory> &categories) |
| void | setCategory(const QPlaceCategory &category) |
| void | setLimit(int limit) |
| void | setRecommendationId(const QString &placeId) |
| void | setRelevanceHint(QPlaceSearchRequest::RelevanceHint hint) |
| void | setSearchArea(const QGeoShape &area) |
| void | setSearchContext(const QVariant &context) |
| void | setSearchTerm(const QString &term) |
| void | setVisibilityScope(QLocation::VisibilityScope scope) |
| QLocation::VisibilityScope | visibilityScope() const |
| QPlaceSearchRequest & | operator=(const QPlaceSearchRequest &other) |
관련 비멤버
| bool | operator!=(const QPlaceSearchRequest &lhs, const QPlaceSearchRequest &rhs) |
| bool | operator==(const QPlaceSearchRequest &lhs, const QPlaceSearchRequest &rhs) |
상세 설명
일반적인 검색 요청은 다음과 같이 보일 수 있습니다.
QPlaceSearchRequest searchRequest;
searchRequest.setSearchTerm("Fast food"); //search term for what we are interested in
//set a search center
searchRequest.setSearchArea(QGeoCircle(QGeoCoordinate(2.3, 48.87)));
//set a distance hint as a relevancy hint.
//closer places have greater weighting in the ranking of results.
searchRequest.setRelevanceHint(QPlaceSearchRequest::DistanceHint);
//use limit to adjust pagination.
//this limits the number of place results to 5 per page.
searchRequest.setLimit(5);
//provide some categories to narrow down search
QList<QPlaceCategory> categories;
categories << diner << restaurant;
searchRequest.setCategories(categories);검색 중심점을 지정하려면 중심점은 있지만 반지름이 없는 원형 검색 영역을 설정하면 됩니다. 기본 반지름은 -1로 설정되어 있으며, 이는 반지름이 정의되지 않았음을 의미합니다. 제공자는 이를 자체적인 기본 반지름을 자유롭게 선택할 수 있는 것으로 해석합니다.
QPlaceSearchRequest는 주로 QPlaceManager 에서 search for places 로 데이터를 전송할 때 사용되지만, generating search term suggestions 에 매개변수를 전달하는 데에도 사용됩니다. 이 맥락에서는 일부 매개변수만 관련될 수 있다는 점에 유의하십시오. 예를 들어, 검색 영역은 관련성 높은 검색 제안을 좁히는 데 유용하지만, 관련성 힌트와 같은 다른 매개변수는 그다지 적용되지 않을 수 있습니다.
또한 제공업체에 따라 지원하는 매개변수가 다를 수 있다는 점에 유의하십시오. 예를 들어, 일부 제공업체는 페이징을 지원하지 않는 반면 다른 제공업체는 지원할 수 있으며, 일부 제공업체는 관련성 힌트를 반영하는 반면 다른 제공업체는 이를 완전히 무시할 수도 있습니다. 자세한 내용은 플러그인 문서를 참조하십시오.
멤버 유형 문서
enum QPlaceSearchRequest::RelevanceHint
장소 검색 결과의 순위를 매기는 데 도움이 되는 힌트를 정의합니다.
| 상수 | 값 | 설명 |
|---|---|---|
QPlaceSearchRequest::UnspecifiedHint | 0 | 명시적인 힌트가 지정되지 않았습니다. |
QPlaceSearchRequest::DistanceHint | 1 | 검색 중심지까지의 거리가 사용자에게 중요합니다. 더 가까운 장소일수록 가중치가 더 높게 적용됩니다. 이 힌트는 쿼리에서 원형 검색 영역이 사용된 경우에만 유용합니다. |
QPlaceSearchRequest::LexicalPlaceNameHint | 2 | 이름에 따른 장소의 알파벳 순서는 사용자에게 중요합니다. |
멤버 함수 설명서
QPlaceSearchRequest::QPlaceSearchRequest()
기본 생성자. 새로운 요청 객체를 생성합니다.
[noexcept] QPlaceSearchRequest::QPlaceSearchRequest(const QPlaceSearchRequest &other)
other 의 복사본을 생성합니다.
[constexpr noexcept default] QPlaceSearchRequest::QPlaceSearchRequest(QPlaceSearchRequest &&other)
QPlaceSearchRequest 의 인스턴스를 move-construct로 생성합니다.
[noexcept] QPlaceSearchRequest::~QPlaceSearchRequest()
요청 객체를 삭제합니다.
QList<QPlaceCategory> QPlaceSearchRequest::categories() const
검색 요청에 사용될 카테고리를 반환합니다. 장소는 해당 카테고리 중 하나에 속하기만 하면 요청에서 일치하는 것으로 간주됩니다.
setCategories()도 참조하십시오 .
void QPlaceSearchRequest::clear()
검색 요청을 지웁니다.
int QPlaceSearchRequest::limit() const
검색 결과에서 가져올 최대 개수를 반환합니다.
limit에 음수 값을 지정하면 이 매개변수는 정의되지 않은 것으로 간주됩니다. 반환할 적절한 결과 개수는 백엔드 제공자가 결정합니다. 기본 limit 값은 -1입니다.
setLimit()도 참조하십시오 .
QString QPlaceSearchRequest::recommendationId() const
유사한 장소에 대한 추천을 검색하는 데 사용될 장소 ID를 반환합니다.
setRecommendationId()도 참조하십시오 .
QPlaceSearchRequest::RelevanceHint QPlaceSearchRequest::relevanceHint() const
요청의 관련성 힌트를 반환합니다. 이 힌트는 결과의 순위를 결정하는 데 도움을 주기 위해 제공자에게 전달되지만, 순위를 강제하는 것은 아닙니다. 예를 들어, 거리 힌트를 제공하면 더 가까운 장소가 더 높은 순위를 차지할 수 있지만, 결과가 반드시 거리에 따라 엄격하게 정렬된다는 의미는 아닙니다.
setRelevanceHint()도 참조하십시오 .
QGeoShape QPlaceSearchRequest::searchArea() const
검색 결과를 제한하는 데 사용될 검색 영역을 반환합니다. 기본 검색 영역은 유효하지 않은 QGeoShape 이며, 이는 특정 검색 영역이 정의되지 않았음을 나타냅니다.
setSearchArea()도 참조하십시오 .
QVariant QPlaceSearchRequest::searchContext() const
이 장소 검색 요청과 관련된 백엔드별 추가 검색 컨텍스트를 반환합니다. 이 검색 컨텍스트는 일반적으로 proposed search results 의 일부로 설정됩니다.
setSearchContext()도 참조하십시오 .
QString QPlaceSearchRequest::searchTerm() const
검색어를 반환합니다.
setSearchTerm()도 참조하십시오 .
void QPlaceSearchRequest::setCategories(const QList<QPlaceCategory> &categories)
지정된 categories 목록에서 검색을 수행하도록 검색 요청을 설정합니다. 검색 중에 반환되는 모든 장소는 categories 중 적어도 하나와 일치합니다.
categories() 및 setCategory()도 참조하십시오 .
void QPlaceSearchRequest::setCategory(const QPlaceCategory &category)
검색 요청을 단일 항목으로 검색하도록 설정합니다. category
setCategories()도 참조하십시오 .
void QPlaceSearchRequest::setLimit(int limit)
검색 결과의 최대 반환 개수를 limit 로 설정합니다.
limit()도 참조하십시오 .
void QPlaceSearchRequest::setRecommendationId(const QString &placeId)
추천 항목을 검색하는 데 사용될 ‘ placeId ’을 설정합니다.
recommendationId()도 참조하십시오 .
void QPlaceSearchRequest::setRelevanceHint(QPlaceSearchRequest::RelevanceHint hint)
장소를 검색할 때 사용할 관련성 hint 을 설정합니다.
relevanceHint()도 참조하십시오 .
void QPlaceSearchRequest::setSearchArea(const QGeoShape &area)
지정된 area 내에서 검색하도록 검색 요청을 설정합니다.
searchArea()도 참조하십시오 .
void QPlaceSearchRequest::setSearchContext(const QVariant &context)
검색 컨텍스트를 context 로 설정합니다.
참고: 이 메서드는 지오 서비스 플러그인이 ` QPlaceSearchResult::ProposedSearchResult` 유형의 검색 결과를 반환할 때 사용하도록 의도되었습니다.
검색 컨텍스트는 백엔드에서 검색 요청과 관련된 추가 정보를 저장하는 데 사용됩니다. 기타 관련 필드도 함께 채워야 합니다. 예를 들어, 검색 컨텍스트가 텍스트 검색을 포함하는 경우, 검색어 역시 ` setSearchTerm()`를 통해 설정되어야 합니다. 검색 컨텍스트를 사용하면 ` Qt Location ` API를 통해 직접 접근할 수 없는 추가 정보를 보관할 수 있습니다.
검색 컨텍스트는 QVariant 에 저장 가능한 모든 유형일 수 있습니다. 검색 컨텍스트의 값은 애플리케이션에서 직접 사용하기 위한 것이 아닙니다.
searchContext()도 참조하십시오 .
void QPlaceSearchRequest::setSearchTerm(const QString &term)
term 에 대한 검색을 설정합니다.
searchTerm()도 참조하십시오 .
void QPlaceSearchRequest::setVisibilityScope(QLocation::VisibilityScope scope)
장소 검색 시 사용되는 ‘ scope ’의 표시 여부를 설정합니다.
visibilityScope()도 참조하십시오 .
QLocation::VisibilityScope QPlaceSearchRequest::visibilityScope() const
장소를 검색할 때 사용되는 가시성 범위를 반환합니다. 기본값은 QLocation::UnspecifiedVisibility 이며, 이는 명시적인 범위가 지정되지 않았음을 의미합니다. 검색 결과에는 모든 범위의 장소가 포함될 수 있습니다.
setVisibilityScope()도 참조하십시오 .
[noexcept] QPlaceSearchRequest &QPlaceSearchRequest::operator=(const QPlaceSearchRequest &other)
이 검색 요청에 other 를 할당하고, 이 검색 요청에 대한 참조를 반환합니다.
관련 비회원
[noexcept] bool operator!=(const QPlaceSearchRequest &lhs, const QPlaceSearchRequest &rhs)
lhs 가 rhs 와 같지 않으면 true를 반환하고, 그렇지 않으면 false를 반환합니다.
[noexcept] bool operator==(const QPlaceSearchRequest &lhs, const QPlaceSearchRequest &rhs)
lhs 가 rhs 와 같으면 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.