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::ContentSupplier | 0 | このコンテンツを提供したサプライヤー |
QPlaceContent::ContentUser | 1 | このコンテンツを提供したユーザー |
QPlaceContent::ContentAttribution | 2 | リッチテキスト形式の帰属情報文字列を返します 注:プロバイダーによっては 、特定のコンテンツ項目が表示される際、そのクレジット情報を常に表示することを義務付けている場合があります。 |
QPlaceContent::ImageId | 3 | 画像の識別子 |
QPlaceContent::ImageUrl | 4 | 画像のURL |
QPlaceContent::ImageMimeType | 5 | 画像のMIMEタイプ |
QPlaceContent::EditorialTitle | 6 | 記事のタイトル |
QPlaceContent::EditorialText | 7 | その場所に関する説明文。プロバイダーによっては、このテキストはリッチテキスト(HTMLベース)またはプレーンテキストのいずれかとなる場合があります。 |
QPlaceContent::EditorialLanguage | 8 | 記事の言語。通常、これは2文字のISO 639-1形式の言語コードとなります。 |
QPlaceContent::ReviewId | 9 | レビューの識別子 |
QPlaceContent::ReviewDateTime | 10 | レビューが投稿された日時 |
QPlaceContent::ReviewTitle | 11 | レビューのタイトル |
QPlaceContent::ReviewText | 12 | レビュー本文。プロバイダーによっては、リッチテキスト(HTMLベース)またはプレーンテキストのいずれかとなる場合があります。 |
QPlaceContent::ReviewLanguage | 13 | レビューの言語。通常、これは2文字のISO 639-1形式の言語コードとなります。 |
QPlaceContent::ReviewRating | 14 | このレビューによる施設の評価 |
QPlaceContent::CustomDataTag | 1000 |
enum QPlaceContent::Type
コンテンツの種類を定義します。
| 定数 | 値 | 説明 |
|---|---|---|
QPlaceContent::NoType | 0 | コンテンツオブジェクトはデフォルトで生成されます。このコンテンツオブジェクトには、他の任意のコンテンツタイプを割り当てることができます。 |
QPlaceContent::ImageType | 1 | コンテンツオブジェクトは画像です |
QPlaceContent::ReviewType | 2 | コンテンツオブジェクトはレビューです |
QPlaceContent::EditorialType | 3 | コンテンツオブジェクトは編集記事です |
QPlaceContent::CustomType | 0x0100 | コンテンツオブジェクトはカスタム型です |
メンバー関数のドキュメント
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.