QPlaceResult

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

Inheritance diagram of PySide2.QtLocation.QPlaceResult

Synopsis

Functions

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() << 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.

class QPlaceResult

QPlaceResult(other)

param other

QPlaceSearchResult

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

qreal

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()

PySide2.QtLocation.QPlaceResult.isSponsored()
Return type

bool

Returns true if the result is a sponsored result.

See also

setSponsored()

PySide2.QtLocation.QPlaceResult.place()
Return type

QPlace

Returns the place of the search result.

See also

setPlace()

PySide2.QtLocation.QPlaceResult.setDistance(distance)
Parameters

distanceqreal

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

See also

distance()

PySide2.QtLocation.QPlaceResult.setPlace(place)
Parameters

placeQPlace

Sets the place that this result refers to.

See also

place()

PySide2.QtLocation.QPlaceResult.setSponsored(sponsored)
Parameters

sponsoredbool

Sets whether the result is a sponsored result or not.

See also

isSponsored()