Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QPlaceSearchResult Class Reference

\inmodule QtLocation More...

#include <qplacesearchresult.h>

+ Inheritance diagram for QPlaceSearchResult:
+ Collaboration diagram for QPlaceSearchResult:

Public Types

enum  SearchResultType { UnknownSearchResult = 0 , PlaceResult , ProposedSearchResult }
 Defines the type of search result. More...
 

Public Member Functions

 QPlaceSearchResult ()
 Constructs a new search result.
 
 QPlaceSearchResult (const QPlaceSearchResult &other)
 Constructs a copy of other.
 
virtual ~QPlaceSearchResult ()
 Destroys the search result.
 
QPlaceSearchResultoperator= (const QPlaceSearchResult &other)
 Assigns other to this search result and returns a reference to this search result.
 
bool operator== (const QPlaceSearchResult &other) const
 Returns true if other is equal to this search result, otherwise returns false.
 
bool operator!= (const QPlaceSearchResult &other) const
 Returns true if other not equal to this search result, otherwise returns false.
 
SearchResultType type () const
 Returns the result type.
 
QString title () const
 Returns the title of the search result.
 
void setTitle (const QString &title)
 Sets the title of the search result to title.
 
QPlaceIcon icon () const
 Returns an icon that can be used to represent the search result.
 
void setIcon (const QPlaceIcon &icon)
 Sets the icon of the search result to icon.
 

Protected Member Functions

 QPlaceSearchResult (QPlaceSearchResultPrivate *d)
 

Protected Attributes

QSharedDataPointer< QPlaceSearchResultPrivated_ptr
 

Friends

class QPlaceSearchResultPrivate
 

Detailed Description

\inmodule QtLocation

Since
5.6

The QPlaceSearchResult class is the base class for search results.

A list of search results can be retrieved from the QPlaceSearchReply after it has successfully completed the request. Common to all search results are the \l {QPlaceSearchResult::title()} {title} and \l {QPlaceSearchResult::icon()}{icon}, which can be used to present the search result to the user.

The intended usage is that depending on the \l {QPlaceSearchResult::type()} {type}, the search result can be converted to a more detailed subclass like so:

The implementation is handled in such a way that object slicing is not an issue. It is not expected that client applications or backend plugins instantiate a QPlaceSearchResult directly, but rather client applications simply convert to search result subclasses and backend plugins only instantiate subclasses.

See also
QPlaceResult

Definition at line 26 of file qplacesearchresult.h.

Member Enumeration Documentation

◆ SearchResultType

Defines the type of search result.

\value UnknownSearchResult The contents of the search result are unknown. \value PlaceResult The search result contains a place. \value ProposedSearchResult The search result contains a proposed search which may be relevant.

Enumerator
UnknownSearchResult 
PlaceResult 
ProposedSearchResult 

Definition at line 41 of file qplacesearchresult.h.

Constructor & Destructor Documentation

◆ QPlaceSearchResult() [1/3]

QPlaceSearchResult::QPlaceSearchResult ( )

Constructs a new search result.

Definition at line 72 of file qplacesearchresult.cpp.

◆ QPlaceSearchResult() [2/3]

QPlaceSearchResult::QPlaceSearchResult ( const QPlaceSearchResult & other)

Constructs a copy of other.

Definition at line 80 of file qplacesearchresult.cpp.

◆ ~QPlaceSearchResult()

QPlaceSearchResult::~QPlaceSearchResult ( )
virtual

Destroys the search result.

Definition at line 88 of file qplacesearchresult.cpp.

◆ QPlaceSearchResult() [3/3]

QPlaceSearchResult::QPlaceSearchResult ( QPlaceSearchResultPrivate * d)
explicitprotected

Constructs a new search result from the given pointer d.

Definition at line 178 of file qplacesearchresult.cpp.

Member Function Documentation

◆ icon()

QPlaceIcon QPlaceSearchResult::icon ( ) const

Returns an icon that can be used to represent the search result.

Definition at line 159 of file qplacesearchresult.cpp.

◆ operator!=()

bool QPlaceSearchResult::operator!= ( const QPlaceSearchResult & other) const
inline

Returns true if other not equal to this search result, otherwise returns false.

Definition at line 37 of file qplacesearchresult.h.

◆ operator=()

QPlaceSearchResult & QPlaceSearchResult::operator= ( const QPlaceSearchResult & other)

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

Definition at line 96 of file qplacesearchresult.cpp.

◆ operator==()

bool QPlaceSearchResult::operator== ( const QPlaceSearchResult & other) const

Returns true if other is equal to this search result, otherwise returns false.

Definition at line 109 of file qplacesearchresult.cpp.

◆ setIcon()

void QPlaceSearchResult::setIcon ( const QPlaceIcon & icon)

Sets the icon of the search result to icon.

Definition at line 168 of file qplacesearchresult.cpp.

◆ setTitle()

void QPlaceSearchResult::setTitle ( const QString & title)

Sets the title of the search result to title.

Definition at line 150 of file qplacesearchresult.cpp.

◆ title()

QString QPlaceSearchResult::title ( ) const

Returns the title of the search result.

This string can be used to display the search result to the user.

Definition at line 141 of file qplacesearchresult.cpp.

◆ type()

QPlaceSearchResult::SearchResultType QPlaceSearchResult::type ( ) const

Returns the result type.

Definition at line 130 of file qplacesearchresult.cpp.

Friends And Related Symbol Documentation

◆ QPlaceSearchResultPrivate

friend class QPlaceSearchResultPrivate
friend

Definition at line 63 of file qplacesearchresult.h.

Member Data Documentation

◆ d_ptr

QSharedDataPointer<QPlaceSearchResultPrivate> QPlaceSearchResult::d_ptr
protected

Definition at line 57 of file qplacesearchresult.h.


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