EditorialModel QML Type

EditorialModel型は、プレイスエディトリアルのモデルを提供します。詳細...

Import Statement: import QtLocation 6.8
Since: QtLocation 5.5

プロパティ

詳細な説明

EditorialModelは、Place に関連する社説をフェッチするために使用される読み取り専用のモデルです。EditorialModel::place を介してPlace をバインドすると、社説の最初のフェッチが開始されます。このモデルはインクリメンタルにフェッチを実行し、ListView のようなViewと共に使用されることを意図しています。Viewが現在モデル内にある社説の最後に達すると、利用可能であればさらに取得するためにフェッチが実行されます。社説が受信されると、Viewは自動的に更新されます。一度にフェッチされる社説の数はbatchSize プロパティで指定します。利用可能な社説の総数は、totalCount プロパティでアクセスできます。

このモデルは以下のロールのデータを返します:

役割タイプ説明
供給者supplierコンテンツのサプライヤー。
ユーザーuserコンテンツを投稿したユーザー。
属性文字列コンテンツを表示する際に表示しなければならない属性テキスト。
urlurl画像のURL。
画像ID文字列画像の識別子。
mimeType文字列画像の MIME タイプ。
テキスト文字列編集者による場所のテキスト説明。プロバイダによってリッチテキスト(HTMLベース)またはプレーンテキストになります。
タイトル文字列社説のタイトル。
言語文字列社説が書かれている言語。
日付日時レビューが投稿された日時。
テキスト文字列レビューのテキストによる場所の説明。プロバイダによってリッチテキスト(HTMLベース)かプレーンテキストのどちらかになります。
言語文字列レビューが書かれている言語。
評価リアルレビュアーがその場所につけた評価。
レビューID文字列レビューの識別子
タイトル文字列レビューのタイトル

次の例は、ある場所の社説を表示する方法を示しています:

import QtQuick
import QtPositioning
import QtLocation

EditorialModel {
    id: editorialModel
    batchSize: 3
    place: place
}

ListView {
    model: editorialModel
    delegate: Item {
        anchors.fill: parent

        Column {
            width: parent.width
            clip: true

            Text {
                text: title
                width: parent.width
                wrapMode: Text.WordWrap
                font.pixelSize: 24
            }

            Text {
                text: text
                width: parent.width
                wrapMode: Text.WordWrap
                font.pixelSize: 20
            }

            Row {
                Image {
                    width: 16
                    height: 16

                    source: supplier.icon.url(Qt.size(width, height), Icon.List)
                }

                Text {
                    text: "Provided by " + supplier.name
                    font.pixelSize: 16
                }
            }

            Text {
                text: "Contributed by " + user.name
                font.pixelSize: 16
            }

            Text {
                text: attribution
                font.pixelSize: 8
            }
        }
    }
}

プロパティ ドキュメント

batchSize : int

このプロパティは、より多くの論説項目を取得するときに使用するバッチサイズを保持します。


place : Place

このプロパティは、社説の対象である場所を保持します。


totalCount : int

このプロパティは、その場所の社説アイテムの総数を保持します。


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