QPlaceResult¶
The
QPlaceResult
class represents a search result containing a place. More…
Synopsis¶
Functions¶
def
distance
()def
isSponsored
()def
place
()def
setDistance
(distance)def
setPlace
(place)def
setSponsored
(sponsored)
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 aQPlaceResult
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
- class PySide2.QtLocation.QPlaceResult¶
PySide2.QtLocation.QPlaceResult(other)
- param other:
Constructs a new place result object.
Constructs a copy of
other
if possible, otherwise constructs a default place result.
- PySide2.QtLocation.QPlaceResult.distance()¶
- Return type:
float
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
- PySide2.QtLocation.QPlaceResult.isSponsored()¶
- Return type:
bool
Returns true if the result is a sponsored result.
See also
- PySide2.QtLocation.QPlaceResult.place()¶
- Return type:
Returns the place of the search result.
See also
- PySide2.QtLocation.QPlaceResult.setDistance(distance)¶
- Parameters:
distance – float
Set the
distance
of the search result’s place from a search center.See also
- PySide2.QtLocation.QPlaceResult.setPlace(place)¶
- Parameters:
place –
PySide2.QtLocation.QPlace
Sets the
place
that this result refers to.See also
- PySide2.QtLocation.QPlaceResult.setSponsored(sponsored)¶
- Parameters:
sponsored – bool
Sets whether the result is a
sponsored
result or not.See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.