Import Statement: import QtLocation 5.15 Since: QtLocation 5.5
-
List of all members, including inherited members
Properties
-
batchSize
: int
-
place
: Place
-
totalCount
: int
Detailed Description
The ImageModel is a read-only model used to fetch images related to a
Place
. Binding a
Place
via
ImageModel::place
initiates an initial fetch of images. The model performs fetches incrementally and is intended to be used in conjunction with a View such as a
ListView
. When the View reaches the last of the images currently in the model, a fetch is performed to retrieve more if they are available. The View is automatically updated as the images are received. The number of images which are fetched at a time is specified by the
batchSize
property. The total number of images available can be accessed via the
totalCount
property.
The model returns data for the following roles:
RoleTypeDescription
urlurlThe URL of the image.
imageIdstringThe identifier of the image.
mimeTypestringThe MIME type of the image.
supplier
Supplier
The supplier of the image.
user
User
The user who contributed the image.
attributionstringAttribution text which must be displayed when displaying the image.
Example
The following example shows how to display images for a place:
import QtQuick 2.0
import QtPositioning 5.5
import QtLocation 5.6
ImageModel {
id: imageModel
batchSize: 3
place: place
ListView {
anchors.top: parent.top
width: parent.width
spacing: 10
model: imageModel
orientation: ListView.Horizontal
snapMode: ListView.SnapOneItem
delegate: Item {
width: listView.width
height: listView.height
Image {
anchors.fill: parent
source: url
fillMode: Image.PreserveAspectFit
Text {
text: supplier.name + "\n" + supplier.url
width: parent.width
anchors.bottom: parent.bottom
Property Documentation
© 2024 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.