EditorialModel QML Type
EditorialModel 型は、社説のモデルを提供します。詳細...
| Import Statement: | import QtLocation 6.12 |
| Since: | QtLocation 5.5 |
プロパティ
- batchSize : int
- place : Place
- totalCount : int
詳細な説明
EditorialModelは、Place に関連する社説を取得するために使用される読み取り専用モデルです。EditorialModel::place を介してPlace をバインドすると、社説の初期取得が開始されます。このモデルは社説の取得を段階的に行い、ListView などのViewと組み合わせて使用することを想定しています。 ビューがモデル内に現在存在する編集記事の最後尾に到達すると、利用可能な編集記事があれば、さらに取得するためのフェッチが実行されます。編集記事が受信されると、ビューは自動的に更新されます。一度にフェッチされる編集記事の数は、batchSize プロパティで指定されます。利用可能な編集記事の総数は、totalCount プロパティを介して取得できます。
このモデルは、以下のロールに関するデータを返します:
| ロール | タイプ | 説明 |
|---|---|---|
| supplier | supplier | コンテンツの提供元。 |
| ユーザー | user | コンテンツを提供したユーザー。 |
| 帰属 | 文字列 | コンテンツを表示する際に表示しなければならない出典表示テキスト。 |
| url | url | 画像のURL。 |
| imageId | 文字列 | 画像の識別子。 |
| mimeType | 文字列 | 画像の MIME タイプ。 |
| text | 文字列 | その場所に関する編集部のテキストによる説明。プロバイダーによって、リッチテキスト(HTMLベース)またはプレーンテキストのいずれかになります。 |
| title | 文字列 | 編集記事のタイトル。 |
| language | 文字列 | 社説が書かれている言語。 |
| dateTime | datetime | レビューが投稿された日時。 |
| 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.