class QPlaceResult

The QPlaceResult class represents a search result containing a place. More

Inheritance diagram of PySide6.QtLocation.QPlaceResult

Synopsis

Methods

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 a QPlaceResult 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.

__init__()

Constructs a new place result object.

__init__(other)
Parameters:

otherQPlaceSearchResult

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

setDistance()

isSponsored()
Return type:

bool

Returns true if the result is a sponsored result.

See also

setSponsored()

place()
Return type:

QPlace

Returns the place of the search result.

See also

setPlace()

setDistance(distance)
Parameters:

distance – float

Set the distance of the search result’s place from a search center.

See also

distance()

setPlace(place)
Parameters:

placeQPlace

Sets the place that this result refers to.

See also

place()

setSponsored(sponsored)
Parameters:

sponsored – bool

Sets whether the result is a sponsored result or not.

See also

isSponsored()