![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtLocation More...
#include <qplacecontent.h>
Public Types | |
enum | Type { NoType = 0 , ImageType , ReviewType , EditorialType , CustomType = 0x0100 } |
Defines the type of content. More... | |
enum | DataTag { ContentSupplier , ContentUser , ContentAttribution , ImageId , ImageUrl , ImageMimeType , EditorialTitle , EditorialText , EditorialLanguage , ReviewId , ReviewDateTime , ReviewTitle , ReviewText , ReviewLanguage , ReviewRating , CustomDataTag = 1000 } |
Defines the value entry of the content object. More... | |
typedef QMap< int, QPlaceContent > | Collection |
Synonym for QMap<int, QPlaceContent>. | |
Public Member Functions | |
QPlaceContent (Type type=NoType) | |
Constructs an content object for type. | |
~QPlaceContent () | |
Destroys the content object. | |
QPlaceContent (const QPlaceContent &other) noexcept | |
Constructs a new copy of other. | |
QPlaceContent & | operator= (const QPlaceContent &other) noexcept |
Assigns the other content object to this and returns a reference to this content object. | |
QPlaceContent (QPlaceContent &&other) noexcept=default | |
void | swap (QPlaceContent &other) noexcept |
void | detach () |
bool | operator== (const QPlaceContent &other) const |
Returns true if this content object is equivalent to other, otherwise returns false. | |
bool | operator!= (const QPlaceContent &other) const |
Returns true if this content object is not equivalent to other, otherwise returns false. | |
QPlaceContent::Type | type () const |
Returns the content type. | |
QList< DataTag > | dataTags () const |
Returns the list of data tags for which values are stored in this content objects. | |
QVariant | value (DataTag tag) const |
Returns the value stored for the data tag, or an invalid QVariant if there is no data for that tag. | |
void | setValue (DataTag tag, const QVariant &) |
Sets the value stored for the data tag to value. | |
Protected Member Functions | |
QPlaceContentPrivate * | d_func () |
const QPlaceContentPrivate * | d_func () const |
Friends | |
class | QPlaceContentPrivate |
\inmodule QtLocation
The QPlaceContent class holds content about places.
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.
Definition at line 21 of file qplacecontent.h.
typedef QMap<int, QPlaceContent> 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.
Definition at line 24 of file qplacecontent.h.
Defines the value entry of the content object.
\value ContentSupplier The supplier who contributed this content \value ContentUser The user who contributed this content \value ContentAttribution Returns a rich text attribution string
Definition at line 34 of file qplacecontent.h.
enum QPlaceContent::Type |
Defines the type of content.
\value NoType The content object is default constructed, any other content type may be assigned to this content object \value ImageType The content object is an image \value ReviewType The content object is a review \value EditorialType The content object is an editorial \value CustomType The content object is of a custom type
Enumerator | |
---|---|
NoType | |
ImageType | |
ReviewType | |
EditorialType | |
CustomType |
Definition at line 26 of file qplacecontent.h.
Constructs an content object for type.
Definition at line 128 of file qplacecontent.cpp.
|
default |
Destroys the content object.
|
defaultnoexcept |
Constructs a new copy of other.
|
defaultnoexcept |
|
inlineprotected |
Definition at line 9 of file qplacecontent.cpp.
|
inlineprotected |
Definition at line 14 of file qplacecontent.cpp.
QList< QPlaceContent::DataTag > QPlaceContent::dataTags | ( | ) | const |
Returns the list of data tags for which values are stored in this content objects.
Definition at line 195 of file qplacecontent.cpp.
void QPlaceContent::detach | ( | ) |
Definition at line 151 of file qplacecontent.cpp.
bool QPlaceContent::operator!= | ( | const QPlaceContent & | other | ) | const |
Returns true if this content object is not equivalent to other, otherwise returns false.
Definition at line 186 of file qplacecontent.cpp.
|
defaultnoexcept |
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.
Definition at line 170 of file qplacecontent.cpp.
void QPlaceContent::setValue | ( | QPlaceContent::DataTag | tag, |
const QVariant & | value ) |
Sets the value stored for the data tag to value.
Definition at line 214 of file qplacecontent.cpp.
|
inlinenoexcept |
Definition at line 61 of file qplacecontent.h.
QPlaceContent::Type QPlaceContent::type | ( | ) | const |
Returns the content type.
Definition at line 159 of file qplacecontent.cpp.
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.
Definition at line 205 of file qplacecontent.cpp.
|
friend |
Definition at line 97 of file qplacecontent.h.