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 <qplaceresult.h>
Public Member Functions | |
QPlaceResult () | |
Constructs a new place result object. | |
virtual | ~QPlaceResult () |
Destructor. | |
qreal | distance () const |
Returns the distance of the place to the search center. | |
void | setDistance (qreal distance) |
Set the distance of the search result's place from a search center. | |
QPlace | place () const |
Returns the place of the search result. | |
void | setPlace (const QPlace &place) |
Sets the place that this result refers to. | |
bool | isSponsored () const |
Returns true if the result is a sponsored result. | |
void | setSponsored (bool sponsored) |
Sets whether the result is a sponsored result or not. | |
Public Member Functions inherited from QPlaceSearchResult | |
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. | |
Additional Inherited Members | |
Public Types inherited from QPlaceSearchResult | |
enum | SearchResultType { UnknownSearchResult = 0 , PlaceResult , ProposedSearchResult } |
Defines the type of search result. More... | |
Protected Member Functions inherited from QPlaceSearchResult | |
QPlaceSearchResult (QPlaceSearchResultPrivate *d) | |
Protected Attributes inherited from QPlaceSearchResult | |
QSharedDataPointer< QPlaceSearchResultPrivate > | d_ptr |
\inmodule QtLocation
The QPlaceResult class represents a search result containing a place.
The PlaceResult holds the distance to the place from the center of the search request, an instance of the place and an indication of whether the result is sponsored or \l {http://en.wikipedia.org/wiki/Organic_search}{organic}.
The intended usage is that a QPlaceSearchResult can be converted into a QPlaceResult like so:
The implementation is handled in such a way that object slicing is not an issue.
Definition at line 14 of file qplaceresult.h.
QPlaceResult::QPlaceResult | ( | ) |
Constructs a new place result object.
Constructs a copy of other if possible, otherwise constructs a default place result.
Definition at line 46 of file qplaceresult.cpp.
|
virtual |
Destructor.
Definition at line 54 of file qplaceresult.cpp.
qreal QPlaceResult::distance | ( | ) | const |
Returns the distance of the place to the search center.
This field is only relevant provided the search request contained a search area with a search center. Otherwise, the distance is NaN indicating an undefined distance. The default value for distance is NaN.
Definition at line 73 of file qplaceresult.cpp.
bool QPlaceResult::isSponsored | ( | ) | const |
Returns true if the result is a sponsored result.
Definition at line 111 of file qplaceresult.cpp.
QPlace QPlaceResult::place | ( | ) | const |
Returns the place of the search result.
Definition at line 91 of file qplaceresult.cpp.
Set the distance of the search result's place from a search center.
Definition at line 82 of file qplaceresult.cpp.
Sets the place that this result refers to.
Definition at line 100 of file qplaceresult.cpp.
void QPlaceResult::setSponsored | ( | bool | sponsored | ) |
Sets whether the result is a sponsored result or not.
Definition at line 122 of file qplaceresult.cpp.