The QML Gallery plugin contains features that can be used to search for and retrieve documents from the Document Gallery.
Searching is performed by creating a filter based on a derived gallery filter class. This results in a set of Gallery QML elements for filtering. The Search parameters can be set by specifying property values which refer to the meta-data of the documents. For example, a meta-data key might be "author". Then, for example, by setting the filter property to "author" and the value to "torvalds" the filter is ready to enable a search for all documents authored by "torvalds".
Available filters include
The GalleryContainsFilter element provides a filter which tests if a meta-data property contains a string. |
|
The GalleryEndsWithFilter element provides a filter which tests if a meta-data property ends with a string. |
|
The GalleryEqualsFilter element provides a filter which tests if a meta-data property is equal to a value. |
|
The GalleryFilterIntersection elements provides a intersection of gallery filters. |
|
The GalleryFilterUnion elements provides a union of gallery filters. |
|
The GalleryGreaterThanEqualsFilter element provides a filter which tests if a meta-data property is greater than or equal to a value. |
|
The GalleryGreaterThanFilter element provides a filter which tests if a meta-data property is greater than a value. |
|
The GalleryLessThanEqualsFilter element provides a filter which tests if a meta-data property is less than or equal to a value. |
|
The GalleryLessThanFilter element provides a filter which tests if a meta-data property is less than a value. |
|
The GalleryStartsWithFilter element provides a filter which tests if a meta-data property starts with a string. |
|
The GalleryWildcardFilter element provides a filter which tests a meta-data property against a value using wildcard matching. |
There is nothing to prevent the developer creating a number of filters. Then she could use either a GalleryFilterUnion or a GalleryFilterIntersection to find the result of OR-ing or AND-ing the criteria respectively to create a more complex search requirement.
DocumentGalleryItems are elements that are a means to request information about a single item from a gallery. The information may include monitoring the state of the request, reading the meta-data for the document or writing meta-data.
When a request is made the status property contains the current status of the request including whether it is active or canceled.
Progress of the request is available through the qreal (floating point number) item property progress.
The DocumentGalleryModel element is used to perform the requests on a document gallery. The following snippet of QML from the DocumentGalleryModel documentation is worth a closer look because it puts together several of the elements discussed in this overview.
import QtMobility.gallery 1.1 ... model: DocumentGalleryModel { rootType: DocumentGallery.Image properties: ["url"] filter: GalleryWildcardFilter { property: "fileName"; value: "*.jpg"; } } ...
Here we have a model using a DocumentGalleryQueryModel. Within Qt the term 'model' usually refers to the Model part of a variation on the Model-View-Controller design pattern. In essence it is a data-oriented part of the Gallery query object, what data types are part of this query. For a clearer understanding see the Qt documentation.
The DocumentGalleryItem element allows you to request information about a single item from the document gallery |
|
The DocumentGalleryModel element is used to specify a model containing items from the document gallery. |
|
The DocumentGalleryType element allows you to request information about an item type from the document gallery. |
|
The GalleryContainsFilter element provides a filter which tests if a meta-data property contains a string. |
|
The GalleryEndsWithFilter element provides a filter which tests if a meta-data property ends with a string. |
|
The GalleryEqualsFilter element provides a filter which tests if a meta-data property is equal to a value. |
|
The GalleryFilterIntersection elements provides a intersection of gallery filters. |
|
The GalleryFilterUnion elements provides a union of gallery filters. |
|
The GalleryGreaterThanEqualsFilter element provides a filter which tests if a meta-data property is greater than or equal to a value. |
|
The GalleryGreaterThanFilter element provides a filter which tests if a meta-data property is greater than a value. |
|
The GalleryLessThanEqualsFilter element provides a filter which tests if a meta-data property is less than or equal to a value. |
|
The GalleryLessThanFilter element provides a filter which tests if a meta-data property is less than a value. |
|
The GalleryStartsWithFilter element provides a filter which tests if a meta-data property starts with a string. |
|
The GalleryWildcardFilter element provides a filter which tests a meta-data property against a value using wildcard matching. |
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.