The QPlaceResult class represents a search result containing a place. More...
Header: | #include <QPlaceResult> |
qmake: | QT += location |
Since: | Qt 5.6 |
Inherits: | QPlaceSearchResult |
QPlaceResult() | |
QPlaceResult(const QPlaceSearchResult &other) | |
virtual | ~QPlaceResult() |
qreal | distance() const |
bool | isSponsored() const |
QPlace | place() const |
void | setDistance(qreal distance) |
void | setPlace(const QPlace &place) |
void | setSponsored(bool sponsored) |
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 organic.
The intended usage is that a QPlaceSearchResult can be converted into a QPlaceResult like so:
if (result.type() == QPlaceSearchResult::PlaceResult) { QPlaceResult placeResult = result; qDebug() << placeResult.place().name(); qDebug() << placeResult.place().location().coordinate(); qDebug() << placeResult.distance(); }
The implementation is handled in such a way that object slicing is not an issue.
See also QPlaceSearchResult.
Constructs a new place result object.
Constructs a copy of other if possible, otherwise constructs a default place result.
[virtual]
QPlaceResult::~QPlaceResult()Destructor.
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.
See also setDistance().
Returns true if the result is a sponsored result.
See also setSponsored().
Returns the place of the search result.
See also setPlace().
Set the distance of the search result's place from a search center.
See also distance().
Sets the place that this result refers to.
See also place().
Sets whether the result is a sponsored result or not.
See also isSponsored().
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: