- Qt 6.11
- Qt Location
- C++ Classes
- QPlaceContent
- Qt 6.11.1 Reference Documentation

# QPlaceContent Class

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

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

- List of all members, including inherited members

## 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

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 Note: Some providers may require that the attribution of a particular content item always be displayed when the content item is shown.
`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` |

### 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

## Member Function Documentation

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

Constructs an content object for type.

### `[noexcept]` QPlaceContent::QPlaceContent(const QPlaceContent &other)

Constructs a new copy of other.

### `[noexcept]` 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.

### `[noexcept]` 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.