このページでは

QPlaceContent Class

QPlaceContent クラスは、場所に関するコンテンツを保持します。詳細...

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

パブリック型

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

パブリック関数

QPlaceContent(QPlaceContent::Type type = NoType)
QPlaceContent(const QPlaceContent &other)
QPlaceContent(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

詳細な説明

QPlaceContent は、画像、レビュー、記事などのリッチなコンテンツに加え、コンテンツのユーザーや提供者といったコンテンツに関する属性も保持します。 コンテンツオブジェクトは複数のデータを保持する場合があります。たとえば、レビューを保持するアイテムには、通常、そのレビューを書いたユーザー情報が含まれます。type() を使用して、QPlaceContent オブジェクトが表すコンテンツのタイプを確認し、dataTags() を使用して、どのデータが保持されているかを確認します。value() を使用して、個々のデータをQVariant として取得します。

注:プロバイダによっては、コンテンツが表示されるたびに、ユーザーに帰属表示文字列を表示することが求められる場合があります。

場所のリッチコンテンツは、通常、ページ分割された項目として提供されます。

現時点では、QPlaceContent クラスはサードパーティによって拡張することはできません。

注:Places API では、コンテンツオブジェクトは「取得専用」のオブジェクトとみなされます。プロバイダへのコンテンツの送信は、サポートされていないユースケースです。

メンバ型のドキュメント

QPlaceContent::Collection

QMap<int,QPlaceContent> の同義語。マップのキーは、コンテンツのインデックスを表すint です。値はコンテンツオブジェクトそのものです。

Collection は、ページとして取得されたコンテンツ項目を格納するためのコンテナとして設計されています。これにより、開発者はページをスキップできるようになります。例えば、インデックス0~9がコレクションに格納されている場合、ユーザーがインデックス80~99にスキップしたとしても、それらも同様にコレクションに格納することができます。

enum QPlaceContent::DataTag

コンテンツオブジェクトの値の入力方法を定義します

定数値説明
QPlaceContent::ContentSupplier0このコンテンツを提供したサプライヤー
QPlaceContent::ContentUser1このコンテンツを提供したユーザー
QPlaceContent::ContentAttribution2リッチテキスト形式の帰属情報文字列を返します

注:プロバイダーによっては 、特定のコンテンツ項目が表示される際、そのクレジット情報を常に表示することを義務付けている場合があります。

QPlaceContent::ImageId3画像の識別子
QPlaceContent::ImageUrl4画像のURL
QPlaceContent::ImageMimeType5画像のMIMEタイプ
QPlaceContent::EditorialTitle6記事のタイトル
QPlaceContent::EditorialText7その場所に関する説明文。プロバイダーによっては、このテキストはリッチテキスト(HTMLベース)またはプレーンテキストのいずれかとなる場合があります。
QPlaceContent::EditorialLanguage8記事の言語。通常、これは2文字のISO 639-1形式の言語コードとなります。
QPlaceContent::ReviewId9レビューの識別子
QPlaceContent::ReviewDateTime10レビューが投稿された日時
QPlaceContent::ReviewTitle11レビューのタイトル
QPlaceContent::ReviewText12レビュー本文。プロバイダーによっては、リッチテキスト(HTMLベース)またはプレーンテキストのいずれかとなる場合があります。
QPlaceContent::ReviewLanguage13レビューの言語。通常、これは2文字のISO 639-1形式の言語コードとなります。
QPlaceContent::ReviewRating14このレビューによる施設の評価
QPlaceContent::CustomDataTag1000 

enum QPlaceContent::Type

コンテンツの種類を定義します。

定数値説明
QPlaceContent::NoType0コンテンツオブジェクトはデフォルトで生成されます。このコンテンツオブジェクトには、他の任意のコンテンツタイプを割り当てることができます。
QPlaceContent::ImageType1コンテンツオブジェクトは画像です
QPlaceContent::ReviewType2コンテンツオブジェクトはレビューです
QPlaceContent::EditorialType3コンテンツオブジェクトは編集記事です
QPlaceContent::CustomType0x0100コンテンツオブジェクトはカスタム型です

メンバー関数のドキュメント

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

type 用のコンテンツオブジェクトを作成します。

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

other の新しいコピーを作成します。

[constexpr noexcept default] QPlaceContent::QPlaceContent(QPlaceContent &&other)

QPlaceContent のインスタンスをMoveコンストラクタで生成します。

[noexcept] QPlaceContent::~QPlaceContent()

コンテンツオブジェクトを破棄します。

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

このコンテンツオブジェクトに値が格納されているデータタグのリストを返します。

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

データ「tag 」に格納されている値を「value 」に設定します。

value()も参照してください 。

QPlaceContent::Type QPlaceContent::type() const

コンテンツタイプを返します。

QVariant QPlaceContent::value(QPlaceContent::DataTag tag) const

データ「tag 」として保存されている値を返します。そのタグに対応するデータがない場合は、無効な「QVariant 」を返します。

setValue()も参照してください 。

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

このコンテンツオブジェクトが `other` と同等でない場合は `true` を返し、それ以外の場合は `false` を返します。

[noexcept] QPlaceContent &QPlaceContent::operator=(const QPlaceContent &other)

other コンテンツオブジェクトをこれに割り当て、このコンテンツオブジェクトへの参照を返します。

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

このコンテンツオブジェクトが `other` と等価である場合は `true` を返し、そうでない場合は `false` を返します。

© 2026 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.