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

ReviewModel QML Type

Provides access to reviews of a Place.

This type was introduced in QtLocation 5.5.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

ReviewModel QML Type

  • Import Statement: import QtLocation 5.12

  • Since: QtLocation 5.5

  • Group: ReviewModel is part of qml-QtLocation5-places, qml-QtLocation5-places-models

Detailed Description

The ReviewModel is a read-only model used to fetch reviews about a Place. The model incrementally fetches. The number of reviews which are fetched at a time is specified by the batchSize property. The total number of reviews available can be accessed via the totalCount property.

To use the ReviewModel we need a view and a delegate. In this snippet we see the setting up of a ListView with a ReviewModel model and a delegate.

 
Sélectionnez
ListView {
    id:view
    property Place place
    signal showReview(variant review)
    width: parent.width
    height: parent.height
    model: place.reviewModel
    delegate: ReviewDelegate {
        onShowReview: view.showReview(model)
    }
}

The model returns data for the following roles:

Role

Type

Description

dateTime

datetime

The date and time that the review was posted.

text

string

The review's textual description of the place. It can be either rich (HTML based) text or plain text depending on the provider.

language

string

The language that the review is written in.

rating

real

The rating that the reviewer gave to the place.

reviewId

string

The identifier of the review.

title

string

The title of the review.

supplier

Supplier

The supplier of the review.

user

User

The user who contributed the review.

attribution

string

Attribution text which must be displayed when displaying the review.

Property Documentation

 

batchSize : int

This property holds the batch size to use when fetching more reviews.

place : Place

This property holds the Place that the reviews are for.

totalCount : int

This property holds the total number of reviews for the place.

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