The DocumentGalleryModel element is used to specify a model containing items from the document gallery. More...
This element is part of the QtMobility.gallery 1.1 module.
The properties that should be returned for each item by the query are specified in properties. In addition all queries return the following properties:
import Qt 4.7 import QtMobility.gallery 1.1 Rectangle { width: 1024 height: 768 GridView { anchors.fill: parent cellWidth: 128 cellHeight: 128 model: DocumentGalleryModel { rootType: DocumentGallery.Image properties: [ "url" ] filter: GalleryWildcardFilter { property: "fileName"; value: "*.jpg"; } } delegate: Image { source: url width: 128 height: 128 } } }
See also DocumentGalleryItem and DocumentGalleryType.
This property holds the current progress of the request, from 0.0 (started) to 1.0 (finished).
properties : QStringList |
This property holds the item properties a query should return values for. All supported properties are listed QDocumentGallery.
This property contains the id of an item that a query should return the descendants of.
This property contains the type of item a query should return. It can be one of:
The default value is DocumentGallery.File
The property contains whether a query should count the direct descendants of the rootItem or all descendants.
sortProperties : QStringList |
This property holds the properties the results of a query should be sorted on.
Prefixing a property name with the '+' character indicates it should be sorted in ascending order, and a '-' character prefix indicates a descending order. If there is no prefix ascending order is assumed.
This property holds the status of a query. It can be one of:
Returns the result at index in a query model.
query.get(0).title
Returns the value of property from the result at index.
query.getProperty(0, "title")
Changes the item at index in the list model with the values in dict. Properties not appearing in dict are left unchanged.
Changes the property of the result at index in a model to value.
model.setProperty(0, "rating", 4)