The QPlaceResult class represents a search result containing a place. 更多...
| 頭: | #include <QPlaceResult> |
| qmake: | QT += location |
| Since: | Qt 5.6 |
| 繼承: | QPlaceSearchResult |
| QPlaceResult () | |
| QPlaceResult (const QPlaceSearchResult & other ) | |
| virtual | ~QPlaceResult () |
| qreal | distance () const |
| bool | isSponsored () const |
| QPlace | place () const |
| void | setDistance (qreal distance ) |
| void | setPlace (const QPlace & place ) |
| void | setSponsored (bool sponsored ) |
The QPlaceResult class represents a search result containing a place.
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 可以被轉換成 QPlaceResult 像這樣:
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.
另請參閱 QPlaceSearchResult .
Constructs a new place result object.
構造副本為 other if possible, otherwise constructs a default place result.
[虛擬]
QPlaceResult::
~QPlaceResult
()
析構函數。
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 ().
Returns true if the result is a sponsored result.
另請參閱 setSponsored ().
Returns the place of the search result.
另請參閱 setPlace ().
設置 distance of the search result's place from a search center.
另請參閱 distance ().
設置 place that this result refers to.
另請參閱 place ().
Sets whether the result is a sponsored result or not.
另請參閱 isSponsored ().