Qt Mobility Reference Documentation

QML GalleryQueryModel Element

The GalleryQueryRequest element is used to specify a model containing items from a gallery. More...

Properties

Signals

Methods

Detailed Description

This element is part of the QtMobility.gallery 1.0 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:

  • itemId The ID of an item.
  • itemUrl The URL of an item.
  • itemType The type of an item.
  • available Whether the meta-data of an item is currently available. Meta-data can be unavailable when an item is outside the loaded range.
  • reading Whether the model is in the process of querying new meta-data values for an item.
  • writing Whether the model is in the process of writing changes to meta-data values back to the gallery.
 import Qt 4.7
 import QtMobility.gallery 1.0

 Rectangle {
     width: 1024
     height: 768

     GridView {
         anchors.fill: parent
         cellWidth: 128
         cellHeight: 128

         model: GalleryQueryModel {
             gallery: DocumentGallery {}

             itemType: "Image"
             properties: ["thumbnailImage"]
             filter: GalleryFilter {
                 property: "fileName";
                 value: "*.jpg";
                 comparator: GalleryFilter.Wildcard
             }
         }

         delegate: Image {
             pixmap: thumbnailImage
         }
     }
 }

See also GalleryItem and GalleryQueryCount.


Property Documentation

currentProgress : int

This property holds the current progress value.


cursorPosition : int

This property holds the offset of a query's internal cache.


filter : GalleryFilter

This property contains criteria to used to filter the results of a query.


This property holds the gallery a query should return results from.


itemType : string

This property contains the type of item a query should return.


live : bool

This property holds whether a query should refresh its results automatically.


maximumProgress : int

This property holds the maximum progress value.


minimumPagedItems : int

This property contains the minimum number of consectutive items a query should retain in it's internal cache.


properties : QStringList

This property holds the item properties a query should return values for.


result : enum

The property holds the result of a query. It can be one of:

  • NoResult The query is still executing.
  • Succeeded The query finished successfully.
  • Cancelled The query was cancelled.
  • NoGallery No gallery was set on the query.
  • NotSupported Queries are not supported by the gallery.
  • ConnectionError The query failed due to a connection error.
  • InvalidItemError The query failed because the value of scopeItemId is not a valid item ID.
  • ItemTypeError The query failed because the value of itemType is not a valid item type.
  • InvalidPropertyError The query failed because the filter refers to an invalid property.
  • PropertyTypeError The query failed because the type of a value in the filter is incompatible with the property.
  • UnsupportedFilterTypeError The query failed because the set filter is not supported by the gallery.
  • UnsupportedFilterOptionError The query failed because an option of a filter is not supported by the gallery.

scope : enum

The property contains whether a query should count the direct descendants of the scopeItemId or all descendants.


scopeItemId : variant

This property contains the id of an item that a query should return a count of the descendants of.


sortProperties : QStringList

This property holds the properties the results of a query should be sorted on.


state : enum

This property holds the state of a query. It can be one of:

  • Inactive The query has finished.
  • Active The query is currently executing.
  • Cancelling The query has been cancelled, but has yet reached the Inactive state.
  • Idle The query has finished and is monitoring its result set for changes.

Signal Documentation

GalleryQueryModel::onCancelled ()

Signals that a query was cancelled.


GalleryQueryModel::onFailed ( error )

Signals that a query failed with the given error.


GalleryQueryModel::onFinished ( result )

Signals that a query finished with the given result.


GalleryQueryModel::onSucceeded ()

Signals that a query has finished successfully.


Method Documentation

GalleryQueryModel::cancel ()

Cancels an executing query.


GalleryQueryModel::clear ()

Clears the results of a query.


GalleryQueryModel::reload ()

Re-queries the gallery.



Copyright © 2009-2010 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.1.0