IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QPlaceResult Class

The QPlaceResult class represents a search result containing a place.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QPlaceResult Class

  • Header: QPlaceResult

  • qmake: QT += location

  • Inherits: QPlaceSearchResult

  • Group: QPlaceResult is part of QtLocation-places, QtLocation-places-data

I. 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:

 
Sélectionnez
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.

I-1. See Also

II. Member Function Documentation

 

II-1. QPlaceResult::QPlaceResult()

Constructs a new place result object.

II-2. QPlaceResult::QPlaceResult(const QPlaceSearchResult &other)

Constructs a copy of other if possible, otherwise constructs a default place result.

II-3. [virtual] QPlaceResult::~QPlaceResult()

Destructor.

II-4. qreal QPlaceResult::distance() const

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.

II-4-1. See Also

See also setDistance()

II-5. bool QPlaceResult::isSponsored() const

Returns true if the result is a sponsored result.

II-5-1. See Also

See also setSponsored()

II-6. QPlace QPlaceResult::place() const

Returns the place of the search result.

II-6-1. See Also

See also setPlace()

II-7. void QPlaceResult::setDistance(qreal distance)

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

II-7-1. See Also

See also distance()

II-8. void QPlaceResult::setPlace(const QPlace &place)

Sets the place that this result refers to.

II-8-1. See Also

See also place()

II-9. void QPlaceResult::setSponsored(bool sponsored)

Sets whether the result is a sponsored result or not.

II-9-1. See Also

See also isSponsored()

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+