QPlaceContentRequest Class

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

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

パブリック関数

QPlaceContentRequest()
QPlaceContentRequest(const 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 のコピーを作成する。

[noexcept] QPlaceContentRequest::~QPlaceContentRequest()

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

void QPlaceContentRequest::clear()

コンテンツ要求をクリアする。

QVariant QPlaceContentRequest::contentContext() const

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

setContentContext()も参照 ください。

QPlaceContent::Type QPlaceContentRequest::contentType() const

レビューや画像など、リクエストするコンテンツの種類を返します。

setContentType()も参照ください

int QPlaceContentRequest::limit() const

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

limit に負の値を指定すると、未定義であることを意味します。適切な件数を返すかどうかは、バックエンドのプロバイダ次第です。

デフォルトの 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)

lhsrhs と等しくなければ真を返し、そうでなければ偽を返す。

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

lhsrhs と等しければ真を返し、そうでなければ偽を返す。

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