このページでは

QPlaceContentRequest Class

QPlaceContentRequest クラスは、コンテンツ要求のパラメータを表します。詳細...

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

パブリック関数

QPlaceContentRequest()
QPlaceContentRequest(const QPlaceContentRequest &other)
QPlaceContentRequest(QPlaceContentRequest &&other)
~QPlaceContentRequest()
void clear()
QVariant contentContext() const
QPlaceContent::Type contentType() const
int limit() const
QString placeId() const
void setContentContext(const QVariant &context)
void setContentType(QPlaceContent::Type type)
void setLimit(int limit)
void setPlaceId(const QString &identifier)
QPlaceContentRequest &operator=(const QPlaceContentRequest &other)
bool operator!=(const QPlaceContentRequest &lhs, const QPlaceContentRequest &rhs)
bool operator==(const QPlaceContentRequest &lhs, const QPlaceContentRequest &rhs)

詳細な説明

QPlaceContentRequest クラスは、QPlaceManager と組み合わせて使用し、画像やレビューなどのリッチコンテンツをページ単位で取得するために使用されます。次のコードは、インデックス 10 から 5 枚の画像のセットをリクエストするものです。

QPlaceContentRequest request;
request.setContentType(QPlaceContent::ImageType);
request.setPlaceId(place.placeId());
request.setLimit(5);

QPlaceContentReply *contentReply = manager->getPlaceContent(request);
//..connect signals..//
    ...
    ...
void contentHandler() {
    if (contentReply->error() == QPlaceReply::NoError)  {
        place.insertContent(contentReply->request().contentType(),
                            contentReply->content());
    }
}

「QPlaceContentReply」も参照してください 。

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

QPlaceContentRequest::QPlaceContentRequest()

新しいリクエストオブジェクトを作成します。

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

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

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

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

[noexcept] QPlaceContentRequest::~QPlaceContentRequest()

リクエストオブジェクトを破棄します

void QPlaceContentRequest::clear()

コンテンツリクエストをクリアします。

QVariant QPlaceContentRequest::contentContext() const

このプレイス・コンテンツのリクエストに関連付けられた、バックエンド固有の追加コンテンツ・コンテキストを返します。

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

QPlaceContent::Type QPlaceContentRequest::contentType() const

リクエストの対象となるコンテンツの種類(レビューや画像など)を返します

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

int QPlaceContentRequest::limit() const

取得するコンテンツ項目の最大数を返します。

limit に負の値が指定された場合、その値は未定義となります。返すアイテムの適切な数は、バックエンドプロバイダに委ねられます。

デフォルトの制限数は -1 です。

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

QString QPlaceContentRequest::placeId() const

コンテンツを取得する対象の場所の識別子を返します。

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

void QPlaceContentRequest::setContentContext(const QVariant &context)

コンテンツコンテキストをcontext に設定します。

注:この メソッドは 、ジオサービスプラグインが場所のコンテンツ結果を返す際に使用することを想定しています。

コンテンツコンテキストは、バックエンドがコンテンツリクエストに関連する追加情報を格納するために使用されます。その他の関連フィールドも入力する必要があります。たとえば、コンテンツリクエストが画像コンテンツを対象とする場合、コンテンツタイプもsetContentType() で設定する必要があります。コンテンツコンテキストを使用することで、Qt Location API からは直接アクセスできない追加のコンテキスト情報を保持することができます。

コンテンツコンテキストは、QVariant に格納可能な任意の型とすることができます。コンテンツコンテキストの値は、アプリケーションが直接使用することを意図したものではありません。

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

void QPlaceContentRequest::setContentType(QPlaceContent::Type type)

リクエストするコンテンツのtype を設定します。

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

void QPlaceContentRequest::setLimit(int limit)

取得するコンテンツ項目の最大数を `limit` に設定します。

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

void QPlaceContentRequest::setPlaceId(const QString &identifier)

コンテンツを取得する場所の識別子を「identifier 」に設定します。

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

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

このコンテンツリクエストにother を割り当て、このコンテンツリクエストへの参照を返します。

関連する非メンバー

[noexcept] bool operator!=(const QPlaceContentRequest &lhs, const QPlaceContentRequest &rhs)

lhs がrhs と等しくない場合は true を返し、それ以外の場合は false を返します。

[noexcept] bool operator==(const QPlaceContentRequest &lhs, const QPlaceContentRequest &rhs)

lhs がrhs と等しい場合は 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.