PySide6.QtLocation.QPlaceResult¶
- class QPlaceResult¶
The
QPlaceResult
class represents a search result containing a place. More…Synopsis¶
Methods¶
def
__init__()
def
distance()
def
isSponsored()
def
place()
def
setDistance()
def
setPlace()
def
setSponsored()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
Warning
This section contains snippets that were automatically translated from C++ to Python and may contain errors.
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: placeResult = result print(placeResult.place().name()) print(placeResult.place().location().coordinate()) print(placeResult.distance())
The implementation is handled in such a way that object slicing is not an issue.
See also
- __init__()¶
Constructs a new place result object.
- __init__(other)
- Parameters:
other –
QPlaceSearchResult
Constructs a copy of
other
if possible, otherwise constructs a default place result.- 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
- isSponsored()¶
- Return type:
bool
Returns true if the result is a sponsored result.
See also
Returns the place of the search result.
See also
- setDistance(distance)¶
- Parameters:
distance – float
Set the
distance
of the search result’s place from a search center.See also
Sets the
place
that this result refers to.See also
- setSponsored(sponsored)¶
- Parameters:
sponsored – bool
Sets whether the result is a
sponsored
result or not.See also