QGalleryQueryModel Class ReferenceThe QGalleryQueryModel class provides a model for the results of a gallery query. More... #include <QGalleryQueryModel> Inherits QAbstractItemModel. Properties
Public Functions
Reimplemented Public Functions
Signals
Additional Inherited Members
Detailed DescriptionThe QGalleryQueryModel class provides a model for the results of a gallery query. The meta-data that should be queried by a QGalleryQueryModel is specified by adding columns to the model, each column has a set of roleProperties() which map item data roles to gallery properties. After the model query has been executed the values of the properties requested for each column can be addressed using the roles they were mapped to. The rootType property identifies the type of gallery item the request should return, if the root type has derivative types (i.e. an audio file is just a special case of a regular file) these will also be included in the result set. The rootItem property takes the ID of an item the query should only return the children of. Depending on the scope of the query this may be {AllDescendents}{all descendents} or just the {DirectDescendents} {direct descendents} of the root item. The results of a query can be further limited by setting a filter on the model. The model will evaluate the QGalleryFilter and only include items with meta-data matching the expression. The order the results are returned in can be specified in the sortPropertyNames property which takes an ordered list of property names. By default properties are sorted in ascending order, but this can be specified explicitly be prefixing the property name with a '+' character for ascending order and a '-' character for descending order. If the autoUpdate property is true when the query is executed it will enter an Idle state on finishing and will refresh the queried information if the items matching the query change. If the gallery can't provide updates it will instead go immediately to the Finished state. Automatic updates can be canceled by calling cancel() on a idle model. See also QGalleryQueryRequest and QDocumentGallery. Property Documentation
|
bool | autoUpdate () const |
void | setAutoUpdate ( bool enabled ) |
Notifier signal:
void | autoUpdateChanged () |
This property holds the error encountered by an unsuccessful query.
Access functions:
int | error () const |
void | error ( int error, const QString & errorString ) |
Notifier signal:
void | errorChanged () |
This property holds a string describing the cause of an error in more detail.
This may be an empty string if more information is not known.
Access functions:
QString | errorString () const |
Notifier signal:
void | errorChanged () |
This property holds a filter restricting the results of a query.
Access functions:
QGalleryFilter | filter () const |
void | setFilter ( const QGalleryFilter & filter ) |
Notifier signal:
void | filterChanged () |
This property holds the Gallery a model executes its queries against.
Access functions:
QAbstractGallery * | gallery () const |
void | setGallery ( QAbstractGallery * gallery ) |
Notifier signal:
void | galleryChanged () |
This property holds the maximum number of items a query should return.
Access functions:
int | limit () const |
void | setLimit ( int limit ) |
Notifier signal:
void | limitChanged () |
This property holds the offset of the first item a query should return.
Access functions:
int | offset () const |
void | setOffset ( int offset ) |
Notifier signal:
void | offsetChanged () |
This property holds the ID of the item a query should return the descendents of.
Access functions:
QVariant | rootItem () const |
void | setRootItem ( const QVariant & itemId ) |
Notifier signal:
void | rootItemChanged () |
See also scope().
This property holds the root item type the results of a query should be restricted to.
Access functions:
QString | rootType () const |
void | setRootType ( const QString & itemType ) |
Notifier signal:
void | rootTypeChanged () |
This property holds whether a query will return all descendents of its root item or just the direct decendents.
Access functions:
QGalleryQueryRequest::Scope | scope () const |
void | setScope ( QGalleryQueryRequest::Scope scope ) |
Notifier signal:
void | scopeChanged () |
See also rootItem().
This property holds a list of names of meta-data 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.
Access functions:
QStringList | sortPropertyNames () const |
void | setSortPropertyNames ( const QStringList & names ) |
Notifier signal:
void | sortPropertyNamesChanged () |
This property holds the state of a query.
Access functions:
QGalleryAbstractRequest::State | state () const |
Notifier signal:
void | stateChanged ( QGalleryAbstractRequest::State state ) |
Constructs a new query model.
The parent is passed to QAbstractItemModel.
Constructs a new model which queries items from a gallery.
The parent is passed to QAbstractItemModel.
Adds a column which maps the given properties to a query model.
The column will not be populated until the query is executed.
Adds a column which maps a meta-data property to role to a query model.
The column will not be populated until the query is executed.
Signals that the value of autoUpdate has changed.
Cancels a query.
Signals that the query was canceled.
Clears the results of a query.
Reimplemented from QAbstractItemModel::columnCount().
Reimplemented from QAbstractItemModel::data().
See also setData().
Signals that the error and errorString properties have changed.
Executes a query.
Signals that the value of filter has changed.
Signals that the query has finished.
Reimplemented from QAbstractItemModel::flags().
Signals that the value of gallery has changed.
Reimplemented from QAbstractItemModel::headerData().
See also setHeaderData().
Reimplemented from QAbstractItemModel::index().
Inserts a column which maps the given properties into a query model at index.
The column will not be populated until the query is executed.
Inserts a column which maps a meta-data property to role into a query model at index.
The column will not be populated until the query is executed.
Returns the ID of the item at index.
Returns the type of the item at index.
Returns the URL of the item at index.
Signals that the value of limit has changed.
Signals that the value of offset has changed.
Reimplemented from QAbstractItemModel::parent().
Removes the column at index from a query model.
Returns the meta-data properties which a column maps to roles.
See also setRoleProperties().
Signals that the value of rootItem has changed.
Signals that the value of rootType has changed.
Reimplemented from QAbstractItemModel::rowCount().
Signals that the value of scope has changed.
Reimplemented from QAbstractItemModel::setData().
See also data().
Reimplemented from QAbstractItemModel::setHeaderData().
See also headerData().
Sets the meta-data properties which a column maps to roles.
New properties will not be populated until the query is executed.
See also roleProperties().
Signals that the value of sortPropertyNames has changed.
Signals that the state of the query has changed.