このページでは

EditorialModel QML Type

EditorialModel 型は、社説のモデルを提供します。詳細...

Import Statement: import QtLocation 6.12
Since: QtLocation 5.5

プロパティ

詳細な説明

EditorialModelは、Place に関連する社説を取得するために使用される読み取り専用モデルです。EditorialModel::place を介してPlace をバインドすると、社説の初期取得が開始されます。このモデルは社説の取得を段階的に行い、ListView などのViewと組み合わせて使用することを想定しています。 ビューがモデル内に現在存在する編集記事の最後尾に到達すると、利用可能な編集記事があれば、さらに取得するためのフェッチが実行されます。編集記事が受信されると、ビューは自動的に更新されます。一度にフェッチされる編集記事の数は、batchSize プロパティで指定されます。利用可能な編集記事の総数は、totalCount プロパティを介して取得できます。

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

ロールタイプ説明
suppliersupplierコンテンツの提供元。
ユーザーuserコンテンツを提供したユーザー。
帰属文字列コンテンツを表示する際に表示しなければならない出典表示テキスト。
urlurl画像のURL。
imageId文字列画像の識別子。
mimeType文字列画像の MIME タイプ。
text文字列その場所に関する編集部のテキストによる説明。プロバイダーによって、リッチテキスト(HTMLベース)またはプレーンテキストのいずれかになります。
title文字列編集記事のタイトル。
language文字列社説が書かれている言語。
dateTimedatetimeレビューが投稿された日時。
text文字列その場所に関するレビューの文章。プロバイダーによって、リッチテキスト(HTMLベース)またはプレーンテキストのいずれかになります。
language文字列レビューが書かれている言語。
rating実数レビュアーがその場所に付けた評価。
reviewId文字列レビューの識別子。
title文字列レビューのタイトル。

例

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

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

このプロパティには、その場所に関する編集項目の総数が格納されています。

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