Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtLocation More...
#include <qplacesearchresult.h>
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. | |
QPlaceSearchResult & | operator= (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< QPlaceSearchResultPrivate > | d_ptr |
Friends | |
class | QPlaceSearchResultPrivate |
\inmodule QtLocation
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.
Definition at line 26 of file qplacesearchresult.h.
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.
QPlaceSearchResult::QPlaceSearchResult | ( | ) |
Constructs a new search result.
Definition at line 72 of file qplacesearchresult.cpp.
QPlaceSearchResult::QPlaceSearchResult | ( | const QPlaceSearchResult & | other | ) |
Constructs a copy of other.
Definition at line 80 of file qplacesearchresult.cpp.
|
virtual |
Destroys the search result.
Definition at line 88 of file qplacesearchresult.cpp.
|
explicitprotected |
Constructs a new search result from the given pointer d.
Definition at line 178 of file qplacesearchresult.cpp.
QPlaceIcon QPlaceSearchResult::icon | ( | ) | const |
Returns an icon that can be used to represent the search result.
Definition at line 159 of file qplacesearchresult.cpp.
|
inline |
Returns true if other not equal to this search result, otherwise returns false.
Definition at line 37 of file qplacesearchresult.h.
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.
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.
void QPlaceSearchResult::setIcon | ( | const QPlaceIcon & | icon | ) |
Sets the icon of the search result to icon.
Definition at line 168 of file qplacesearchresult.cpp.
Sets the title of the search result to title.
Definition at line 150 of file qplacesearchresult.cpp.
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.
QPlaceSearchResult::SearchResultType QPlaceSearchResult::type | ( | ) | const |
Returns the result type.
Definition at line 130 of file qplacesearchresult.cpp.
|
friend |
Definition at line 63 of file qplacesearchresult.h.
|
protected |
Definition at line 57 of file qplacesearchresult.h.