内容表

上一话题

QPlaceReply

下一话题

QPlaceReview

QPlaceResult

QPlaceResult class represents a search result containing a place. 更多

Inheritance diagram of PySide2.QtLocation.QPlaceResult

概要

函数

详细描述

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.

构造副本为 other if possible, otherwise constructs a default place result.

PySide2.QtLocation.QPlaceResult. distance ( )
返回类型

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.

另请参阅

setDistance()

PySide2.QtLocation.QPlaceResult. isSponsored ( )
返回类型

bool

Returns true if the result is a sponsored result.

另请参阅

setSponsored()

PySide2.QtLocation.QPlaceResult. place ( )
返回类型

QPlace

Returns the place of the search result.

另请参阅

setPlace()

PySide2.QtLocation.QPlaceResult. setDistance ( distance )
参数

distance qreal

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

另请参阅

distance()

PySide2.QtLocation.QPlaceResult. setPlace ( place )
参数

place QPlace

设置 place that this result refers to.

另请参阅

place()

PySide2.QtLocation.QPlaceResult. setSponsored ( sponsored )
参数

sponsored bool

Sets whether the result is a sponsored result or not.

另请参阅

isSponsored()