QPlaceContent Class

The QPlaceContent class holds content about places. More...

Header: #include <QPlaceContent>
qmake: QT += location

Public Types

Collection
enum DataTag { ContentSupplier, ContentUser, ContentAttribution, ImageId, ImageUrl, …, CustomDataTag }
enum Type { NoType, ImageType, ReviewType, EditorialType, CustomType }

Public Functions

QPlaceContent(QPlaceContent::Type type = NoType)
QPlaceContent(const QPlaceContent &other)
~QPlaceContent()
QList<QPlaceContent::DataTag> dataTags() const
void setValue(QPlaceContent::DataTag tag, const QVariant &value)
QPlaceContent::Type type() const
QVariant value(QPlaceContent::DataTag tag) const
bool operator!=(const QPlaceContent &other) const
QPlaceContent &operator=(const QPlaceContent &other)
bool operator==(const QPlaceContent &other) const

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.

Member Type Documentation

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.

enum QPlaceContent::DataTag

Defines the value entry of the content object

ConstantValueDescription
QPlaceContent::ContentSupplier0The supplier who contributed this content
QPlaceContent::ContentUser1The user who contributed this content
QPlaceContent::ContentAttribution2Returns a rich text attribution string

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

ConstantValueDescription
QPlaceContent::ImageId3The image's identifier
QPlaceContent::ImageUrl4The image's url
QPlaceContent::ImageMimeType5The image's MIME type
QPlaceContent::EditorialTitle6The title of the editorial
QPlaceContent::EditorialText7A textual description of the place. Depending upon the provider, the text could be either rich (HTML based) text or plain text.
QPlaceContent::EditorialLanguage8The language of the editorial. Typically this would be a language code in the 2 letter ISO 639-1 format.
QPlaceContent::ReviewId9The identifier of the review
QPlaceContent::ReviewDateTime10The date and time that the review was submitted
QPlaceContent::ReviewTitle11The title of the review
QPlaceContent::ReviewText12The text of the review. Depending on the provider, the text could be rich (HTML based) or plain text.
QPlaceContent::ReviewLanguage13The language of the review. Typically this would be a language code in the 2 letter ISO 639-1 format.
QPlaceContent::ReviewRating14This review's rating of the place
QPlaceContent::CustomDataTag1000 

enum QPlaceContent::Type

Defines the type of content.

ConstantValueDescription
QPlaceContent::NoType0The content object is default constructed, any other content type may be assigned to this content object
QPlaceContent::ImageType1The content object is an image
QPlaceContent::ReviewType2The content object is a review
QPlaceContent::EditorialType3The content object is an editorial
QPlaceContent::CustomType0x0100The content object is of a custom type

Member Function Documentation

QPlaceContent::QPlaceContent(QPlaceContent::Type type = NoType)

Constructs an content object for type.

QPlaceContent::QPlaceContent(const QPlaceContent &other)

Constructs a new copy of other.

QPlaceContent::~QPlaceContent()

Destroys the content object.

QList<QPlaceContent::DataTag> QPlaceContent::dataTags() const

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

void QPlaceContent::setValue(QPlaceContent::DataTag tag, const QVariant &value)

Sets the value stored for the data tag to value.

See also value().

QPlaceContent::Type QPlaceContent::type() const

Returns the content type.

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.

See also setValue().

bool QPlaceContent::operator!=(const QPlaceContent &other) const

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

QPlaceContent &QPlaceContent::operator=(const QPlaceContent &other)

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

bool QPlaceContent::operator==(const QPlaceContent &other) const

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

© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.