Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPlaceSearchRequest Class Reference

\inmodule QtLocation More...

#include <qplacesearchrequest.h>

+ Collaboration diagram for QPlaceSearchRequest:

Public Types

enum  RelevanceHint { UnspecifiedHint , DistanceHint , LexicalPlaceNameHint }
 Defines hints to help rank place results. More...
 

Public Member Functions

 QPlaceSearchRequest ()
 Default constructor.
 
 QPlaceSearchRequest (const QPlaceSearchRequest &other) noexcept
 Constructs a copy of other.
 
 QPlaceSearchRequest (QPlaceSearchRequest &&other) noexcept=default
 
 ~QPlaceSearchRequest ()
 Destroys the request object.
 
QPlaceSearchRequestoperator= (const QPlaceSearchRequest &other) noexcept
 Assigns other to this search request and returns a reference to this search request.
 
void swap (QPlaceSearchRequest &other) noexcept
 
QString searchTerm () const
 Returns the search term.
 
void setSearchTerm (const QString &term)
 Sets the search term.
 
QList< QPlaceCategorycategories () const
 Return the categories to be used in the search request.
 
void setCategory (const QPlaceCategory &category)
 Sets the search request to search by a single category.
 
void setCategories (const QList< QPlaceCategory > &categories)
 Sets the search request to search from the list of given categories.
 
QGeoShape searchArea () const
 Returns the search area which will be used to limit search results.
 
void setSearchArea (const QGeoShape &area)
 Sets the search request to search within the given area.
 
QString recommendationId () const
 Returns the place id which will be used to search for recommendations for similar places.
 
void setRecommendationId (const QString &recommendationId)
 Sets the placeId which will be used to search for recommendations.
 
QVariant searchContext () const
 Returns backend specific additional search context associated with this place search request.
 
void setSearchContext (const QVariant &context)
 Sets the search context to context.
 
QLocation::VisibilityScope visibilityScope () const
 Returns the visibility scope used when searching for places.
 
void setVisibilityScope (QLocation::VisibilityScope visibilityScopes)
 Sets the visibility scope used when searching for places.
 
RelevanceHint relevanceHint () const
 Returns the relevance hint of the request.
 
void setRelevanceHint (RelevanceHint hint)
 Sets the relevance hint to be used when searching for a place.
 
int limit () const
 Returns the maximum number of search results to retrieve.
 
void setLimit (int limit)
 Set the maximum number of search results to retrieve to limit.
 
void clear ()
 Clears the search request.
 

Friends

class QPlaceSearchRequestPrivate
 
bool operator== (const QPlaceSearchRequest &lhs, const QPlaceSearchRequest &rhs) noexcept
 Returns true if lhs is equal to rhs, otherwise returns false.
 
bool operator!= (const QPlaceSearchRequest &lhs, const QPlaceSearchRequest &rhs) noexcept
 Returns true if lhs is not equal to rhs, otherwise returns false.
 

Detailed Description

\inmodule QtLocation

Since
5.6

The QPlaceSearchRequest class represents the set of parameters for a search request.

A typical search request may look like the following:

Note that specifying a search center can be done by setting a circular search area that has a center but no radius. The default radius is set to -1, which indicates an undefined radius. The provider will interpret this as being free to choose its own default radius.

The QPlaceSearchRequest is primarily used with the QPlaceManager to \l {QPlaceManager::search()} {search for places}, however it is also used to provide parameters for \l {QPlaceManager::searchSuggestions()}{generating search term suggestions}. Note that in this context only some of the parameters may be relevant. For example, the search area is useful in narrowing down relevant search suggestions, while other parameters such as relevance hint are not so applicable.

Also be aware that providers may vary by which parameters they support for example some providers may not support paging while others do, some providers may honor relevance hints while others may completely ignore them, see the \l {Qt Location::Plugin References and Parameters}{plugin documentation} for more details.

Definition at line 18 of file qplacesearchrequest.h.

Member Enumeration Documentation

◆ RelevanceHint

Defines hints to help rank place results.

\value UnspecifiedHint No explicit hint has been specified. \value DistanceHint Distance to a search center is relevant for the user. Closer places are more highly weighted. This hint is only useful if a circular search area is used in the query. \value LexicalPlaceNameHint Alphabetic ordering of places according to name is relevant to the user.

Enumerator
UnspecifiedHint 
DistanceHint 
LexicalPlaceNameHint 

Definition at line 21 of file qplacesearchrequest.h.

Constructor & Destructor Documentation

◆ QPlaceSearchRequest() [1/3]

QPlaceSearchRequest::QPlaceSearchRequest ( )

Default constructor.

Constructs an new request object.

Definition at line 104 of file qplacesearchrequest.cpp.

◆ QPlaceSearchRequest() [2/3]

QPlaceSearchRequest::QPlaceSearchRequest ( const QPlaceSearchRequest & other)
defaultnoexcept

Constructs a copy of other.

◆ QPlaceSearchRequest() [3/3]

QPlaceSearchRequest::QPlaceSearchRequest ( QPlaceSearchRequest && other)
defaultnoexcept

◆ ~QPlaceSearchRequest()

QPlaceSearchRequest::~QPlaceSearchRequest ( )
default

Destroys the request object.

Member Function Documentation

◆ categories()

QList< QPlaceCategory > QPlaceSearchRequest::categories ( ) const

Return the categories to be used in the search request.

Places need only to belong to one of the categories to be considered a match by the request.

Definition at line 173 of file qplacesearchrequest.cpp.

References d.

Referenced by QDeclarativeSearchResultModel::categories_append(), and setCategories().

+ Here is the caller graph for this function:

◆ clear()

void QPlaceSearchRequest::clear ( )

Clears the search request.

Definition at line 341 of file qplacesearchrequest.cpp.

References d.

◆ limit()

int QPlaceSearchRequest::limit ( ) const

Returns the maximum number of search results to retrieve.

A negative value for limit means that it is undefined. It is left up to the backend provider to choose an appropriate number of results to return. The default limit is -1.

Definition at line 323 of file qplacesearchrequest.cpp.

References d.

Referenced by QDeclarativeSearchModelBase::limit(), QDeclarativeSearchModelBase::setLimit(), and setLimit().

+ Here is the caller graph for this function:

◆ operator=()

QPlaceSearchRequest & QPlaceSearchRequest::operator= ( const QPlaceSearchRequest & other)
noexcept

Assigns other to this search request and returns a reference to this search request.

Definition at line 123 of file qplacesearchrequest.cpp.

References other().

+ Here is the call graph for this function:

◆ recommendationId()

QString QPlaceSearchRequest::recommendationId ( ) const

Returns the place id which will be used to search for recommendations for similar places.

Definition at line 229 of file qplacesearchrequest.cpp.

References d.

Referenced by QDeclarativeSearchResultModel::recommendationId(), and QDeclarativeSearchResultModel::setRecommendationId().

+ Here is the caller graph for this function:

◆ relevanceHint()

QPlaceSearchRequest::RelevanceHint QPlaceSearchRequest::relevanceHint ( ) const

Returns the relevance hint of the request.

The hint is given to the provider to help but not dictate the ranking of results. For example providing a distance hint may give closer places a higher ranking but it doesn't necessarily mean that he results will be ordered strictly according to distance.

Definition at line 302 of file qplacesearchrequest.cpp.

References d.

Referenced by QDeclarativeSearchResultModel::relevanceHint(), and QDeclarativeSearchResultModel::setRelevanceHint().

+ Here is the caller graph for this function:

◆ searchArea()

QGeoShape QPlaceSearchRequest::searchArea ( ) const

Returns the search area which will be used to limit search results.

The default search area is an invalid QGeoShape, indicating that no specific search area is defined.

Definition at line 210 of file qplacesearchrequest.cpp.

References d.

Referenced by QDeclarativeSearchModelBase::searchArea(), and QDeclarativeSearchModelBase::setSearchArea().

+ Here is the caller graph for this function:

◆ searchContext()

QVariant QPlaceSearchRequest::searchContext ( ) const

Returns backend specific additional search context associated with this place search request.

The search context is typically set as part of a \l {QPlaceSearchResult::ProposedSearchResult}{proposed search results}.

Definition at line 249 of file qplacesearchrequest.cpp.

References d.

◆ searchTerm()

QString QPlaceSearchRequest::searchTerm ( ) const

Returns the search term.

Definition at line 153 of file qplacesearchrequest.cpp.

References d.

Referenced by QDeclarativeSearchResultModel::searchTerm(), QDeclarativeSearchSuggestionModel::searchTerm(), QDeclarativeSearchResultModel::setSearchTerm(), and QDeclarativeSearchSuggestionModel::setSearchTerm().

+ Here is the caller graph for this function:

◆ setCategories()

void QPlaceSearchRequest::setCategories ( const QList< QPlaceCategory > & categories)

Sets the search request to search from the list of given categories.

Any places returned during the search will match at least one of the categories.

See also
setCategory()

Definition at line 200 of file qplacesearchrequest.cpp.

References categories(), and d.

Referenced by QDeclarativeSearchResultModel::categories_append(), and QDeclarativeSearchResultModel::categories_clear().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCategory()

void QPlaceSearchRequest::setCategory ( const QPlaceCategory & category)

Sets the search request to search by a single category.

See also
setCategories()

Definition at line 184 of file qplacesearchrequest.cpp.

References category(), and d.

+ Here is the call graph for this function:

◆ setLimit()

void QPlaceSearchRequest::setLimit ( int limit)

Set the maximum number of search results to retrieve to limit.

Definition at line 332 of file qplacesearchrequest.cpp.

References d, and limit().

Referenced by RequestHandler::searchPaging(), and QDeclarativeSearchModelBase::setLimit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRecommendationId()

void QPlaceSearchRequest::setRecommendationId ( const QString & recommendationId)

Sets the placeId which will be used to search for recommendations.

Definition at line 238 of file qplacesearchrequest.cpp.

References d.

Referenced by QDeclarativeSearchResultModel::setRecommendationId().

+ Here is the caller graph for this function:

◆ setRelevanceHint()

void QPlaceSearchRequest::setRelevanceHint ( QPlaceSearchRequest::RelevanceHint hint)

Sets the relevance hint to be used when searching for a place.

Definition at line 311 of file qplacesearchrequest.cpp.

References d, and hint().

Referenced by QDeclarativeSearchResultModel::setRelevanceHint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSearchArea()

void QPlaceSearchRequest::setSearchArea ( const QGeoShape & area)

Sets the search request to search within the given area.

Definition at line 219 of file qplacesearchrequest.cpp.

References area(), and d.

Referenced by QDeclarativeSearchModelBase::setSearchArea().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSearchContext()

void QPlaceSearchRequest::setSearchContext ( const QVariant & context)

Sets the search context to context.

Note
This method is intended to be used by geo service plugins when returning search results of type \l QPlaceSearchResult::ProposedSearchResult.

The search context is used by backends to store additional search context related to the search request. Other relevant fields should also be filled in. For example, if the search context encodes a text search the search term should also be set with \l setSearchTerm(). The search context allows additional search context to be kept which is not directly accessible via the Qt Location API.

The search context can be of any type storable in a QVariant. The value of the search context is not intended to be use directly by applications.

Definition at line 270 of file qplacesearchrequest.cpp.

References context, and d.

Referenced by QDeclarativeSearchResultModel::categories_append(), QDeclarativeSearchResultModel::categories_clear(), and QDeclarativeSearchResultModel::setSearchTerm().

+ Here is the caller graph for this function:

◆ setSearchTerm()

void QPlaceSearchRequest::setSearchTerm ( const QString & term)

Sets the search term.

Definition at line 162 of file qplacesearchrequest.cpp.

References d.

Referenced by RequestHandler::search(), RequestHandler::searchRequest(), QDeclarativeSearchResultModel::setSearchTerm(), QDeclarativeSearchSuggestionModel::setSearchTerm(), and RequestHandler::simpleSearch().

+ Here is the caller graph for this function:

◆ setVisibilityScope()

void QPlaceSearchRequest::setVisibilityScope ( QLocation::VisibilityScope visibilityScopes)

Sets the visibility scope used when searching for places.

Definition at line 290 of file qplacesearchrequest.cpp.

References d.

◆ swap()

void QPlaceSearchRequest::swap ( QPlaceSearchRequest & other)
inlinenoexcept

Definition at line 35 of file qplacesearchrequest.h.

References other().

+ Here is the call graph for this function:

◆ visibilityScope()

QLocation::VisibilityScope QPlaceSearchRequest::visibilityScope ( ) const

Returns the visibility scope used when searching for places.

The default value is QLocation::UnspecifiedVisibility meaning that no explicit scope has been assigned. Places of any scope may be returned during the search.

Definition at line 281 of file qplacesearchrequest.cpp.

References d.

Friends And Related Symbol Documentation

◆ operator!=

bool QPlaceSearchRequest::operator!= ( const QPlaceSearchRequest & lhs,
const QPlaceSearchRequest & rhs )
friend

Returns true if lhs is not equal to rhs, otherwise returns false.

Definition at line 40 of file qplacesearchrequest.h.

◆ operator==

bool QPlaceSearchRequest::operator== ( const QPlaceSearchRequest & lhs,
const QPlaceSearchRequest & rhs )
friend

Returns true if lhs is equal to rhs, otherwise returns false.

Definition at line 37 of file qplacesearchrequest.h.

◆ QPlaceSearchRequestPrivate

friend class QPlaceSearchRequestPrivate
friend

Definition at line 79 of file qplacesearchrequest.h.


The documentation for this class was generated from the following files: