QtLocation.ImageModel

The ImageModel type provides a model of place images. More...

Import Statement: import QtLocation 5.3
Since: Qt Location 5.0

Properties

Detailed Description

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.
supplierSupplierThe supplier of the image.
userUserThe 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.2
import QtLocation 5.3
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

batchSize : int

This property holds the batch size to use when fetching more image items.


place : Place

This property holds the Place that the images are for.


totalCount : int

This property holds the total number of image items for the place.