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

QPlaceContent Class

The QPlaceContent class holds content about places.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QPlaceContent Class

  • Header: QPlaceContent

  • qmake: QT += location

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

I. Detailed Description

A QPlaceContent holds rich content such as images, reviews, or editorials, as well as attributes about the content such as the user or supplier of the content. Content objects might hold multiple data, e.g. an item holding a review typically includes the user that wrote the review. Use type() to inspect the type of content a QPlaceContent object represents, and dataTags() to see which data is held. Use value() to get the individual data as a QVariant.

Note: Some providers may require that the attribution string be displayed to the user whenever a piece of content is viewed.

The rich content of a place is typically made available as paginated items.

At present the QPlaceContent class is not extensible by 3rd parties.

Note: The Places API considers content objects to be 'retrieve-only' objects. Submission of content to a provider is not a supported use case.

II. Member Type Documentation

 

II-1. QPlaceContent::Collection

Synonym for QMap<int, QPlaceContent>. The key of the map is an int representing the index of the content. The value is the content object itself.

The Collection is intended to be a container where content items, that have been retrieved as pages, can be stored. This enables a developer to skip pages, for example indexes 0-9 may be stored in the collection, if the user skips to indexes 80-99, these can be stored in the collection as well.

II-2. enum QPlaceContent::DataTag

Defines the value entry of the content object

Constant

Value

Description

QPlaceContent::ContentSupplier

0

The supplier who contributed this content

QPlaceContent::ContentUser

1

The user who contributed this content

QPlaceContent::ContentAttribution

2

Returns a rich text attribution string

Some providers may require that the attribution of a particular content item always be displayed when the content item is shown.

Constant

Value

Description

QPlaceContent::ImageId

3

The image's identifier

QPlaceContent::ImageUrl

4

The image's url

QPlaceContent::ImageMimeType

5

The image's MIME type

QPlaceContent::EditorialTitle

6

The title of the editorial

QPlaceContent::EditorialText

7

A textual description of the place. Depending upon the provider, the text could be either rich (HTML based) text or plain text.

QPlaceContent::EditorialLanguage

8

The language of the editorial. Typically this would be a language code in the 2 letter ISO 639-1 format.

QPlaceContent::ReviewId

9

The identifier of the review

QPlaceContent::ReviewDateTime

10

The date and time that the review was submitted

QPlaceContent::ReviewTitle

11

The title of the review

QPlaceContent::ReviewText

12

The text of the review. Depending on the provider, the text could be rich (HTML based) or plain text.

QPlaceContent::ReviewLanguage

13

The language of the review. Typically this would be a language code in the 2 letter ISO 639-1 format.

QPlaceContent::ReviewRating

14

This review's rating of the place

QPlaceContent::CustomDataTag

1000

 

II-3. enum QPlaceContent::Type

Defines the type of content.

Constant

Value

Description

QPlaceContent::NoType

0

The content object is default constructed, any other content type may be assigned to this content object

QPlaceContent::ImageType

1

The content object is an image

QPlaceContent::ReviewType

2

The content object is a review

QPlaceContent::EditorialType

3

The content object is an editorial

QPlaceContent::CustomType

0x0100

The content object is of a custom type

III. Member Function Documentation

 

III-1. QPlaceContent::QPlaceContent(QPlaceContent::Type type = NoType)

Constructs an content object for type.

III-2. QPlaceContent::QPlaceContent(const QPlaceContent &other)

Constructs a new copy of other.

III-3. QPlaceContent::~QPlaceContent()

Destroys the content object.

III-4. QList<QPlaceContent::DataTag> QPlaceContent::dataTags() const

Returns the list of data tags for which values are stored in this content objects.

III-5. void QPlaceContent::setValue(QPlaceContent::DataTag tag, const QVariant &value)

Sets the value stored for the data tag to value.

III-5-1. See Also

See also value()

III-6. QPlaceContent::Type QPlaceContent::type() const

Returns the content type.

III-7. QVariant QPlaceContent::value(QPlaceContent::DataTag tag) const

Returns the value stored for the data tag, or an invalid QVariant if there is no data for that tag.

III-7-1. See Also

See also setValue()

III-8. bool QPlaceContent::operator!=(const QPlaceContent &other) const

Returns true if this content object is not equivalent to other, otherwise returns false.

III-9. QPlaceContent &QPlaceContent::operator=(const QPlaceContent &other)

Assigns the other content object to this and returns a reference to this content object.

III-10. bool QPlaceContent::operator==(const QPlaceContent &other) const

Returns true if this content object is equivalent to other, otherwise returns false.

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