QPlaceResult Class▲
-
Header: QPlaceResult
-
qmake: QT += location
-
Inherits: QPlaceSearchResult
-
Group: QPlaceResult is part of QtLocation-places, QtLocation-places-data
I. Detailed Description▲
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() &
lt;&
lt; placeResult.place().name();
qDebug() &
lt;&
lt; placeResult.place().location().coordinate();
qDebug() &
lt;&
lt; placeResult.distance();
}
The implementation is handled in such a way that object slicing is not an issue.
I-1. See Also▲
See also QPlaceSearchResult
II. Member Function Documentation▲
II-1. QPlaceResult::QPlaceResult()▲
Constructs a new place result object.
II-2. QPlaceResult::QPlaceResult(const QPlaceSearchResult &other)▲
Constructs a copy of other if possible, otherwise constructs a default place result.
II-3. [virtual] QPlaceResult::~QPlaceResult()▲
Destructor.
II-4. 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.
II-4-1. See Also▲
See also setDistance()
II-5. bool QPlaceResult::isSponsored() const▲
II-6. QPlace QPlaceResult::place() const▲
II-7. void QPlaceResult::setDistance(qreal distance)▲
Set the distance of the search result's place from a search center.
II-7-1. See Also▲
See also distance()