Qt Mobility Reference Documentation

QGalleryQueryModel Class Reference

The QGalleryQueryModel class provides a model for the results of a gallery query. More...

 #include <QGalleryQueryModel>

Properties


Public Functions

QGalleryQueryModel ( QObject * parent = 0 )
QGalleryQueryModel ( QAbstractGallery * gallery, QObject * parent = 0 )
~QGalleryQueryModel ()
void addColumn ( const QHash<int, QString> & properties )
void addColumn ( const QString & property, int role = Qt::DisplayRole )
bool autoUpdate () const
void cancel ()
void clear ()
int columnCount ( const QModelIndex & parent = QModelIndex() ) const
QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const
int error () const
QString errorString () const
void execute ()
QGalleryFilter filter () const
Qt::ItemFlags flags ( const QModelIndex & index ) const
QAbstractGallery * gallery () const
QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const
QModelIndex index ( int row, int column, const QModelIndex & parent = QModelIndex() ) const
void insertColumn ( int index, const QHash<int, QString> & properties )
void insertColumn ( int index, const QString & property, int role = Qt::DisplayRole )
QVariant itemId ( const QModelIndex & index ) const
QString itemType ( const QModelIndex & index ) const
QUrl itemUrl ( const QModelIndex & index ) const
int limit () const
int offset () const
QModelIndex parent ( const QModelIndex & index ) const
void removeColumn ( int index )
QHash<int, QString> roleProperties ( int column ) const
QVariant rootItem () const
QString rootType () const
int rowCount ( const QModelIndex & parent = QModelIndex() ) const
QGalleryQueryRequest::Scope scope () const
void setAutoUpdate ( bool enabled )
bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole )
void setFilter ( const QGalleryFilter & filter )
void setGallery ( QAbstractGallery * gallery )
bool setHeaderData ( int section, Qt::Orientation orientation, const QVariant & value, int role = Qt::EditRole )
void setLimit ( int limit )
void setOffset ( int offset )
void setRoleProperties ( int column, const QHash<int, QString> & properties )
void setRootItem ( const QVariant & itemId )
void setRootType ( const QString & itemType )
void setScope ( QGalleryQueryRequest::Scope scope )
void setSortPropertyNames ( const QStringList & names )
QStringList sortPropertyNames () const
QGalleryAbstractRequest::Status status () const

Signals

void cancelled ()
void error ( int error, const QString & errorString )
void errorChanged ()
void finished ()
void statusChanged ( QGalleryAbstractRequest::Status status )

Detailed Description

The QGalleryQueryModel class provides a model for the results of a gallery query.


Property Documentation

autoUpdate : bool

This property holds whether a query should continue to update its result set after the initial query succeeded.

Access functions:

bool autoUpdate () const
void setAutoUpdate ( bool enabled )

error : const int

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 ()

errorString : const QString

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 ()

filter : QGalleryFilter

This property holds a filter restricting the results of a query.

Access functions:

QGalleryFilter filter () const
void setFilter ( const QGalleryFilter & filter )

gallery : QAbstractGallery *

This property holds the Gallery a model executes its queries against.

Access functions:

QAbstractGallery * gallery () const
void setGallery ( QAbstractGallery * gallery )

limit : int

This property holds the maximum number of items a query should return.

Access functions:

int limit () const
void setLimit ( int limit )

offset : int

This property holds the offset of the first item a query should return.

Access functions:

int offset () const
void setOffset ( int offset )

rootItem : QVariant

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 )

See also scope().

rootType : QString

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 )

scope : QGalleryQueryRequest::Scope

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 )

See also rootItem().

sortPropertyNames : QStringList

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 )

status : const QGalleryAbstractRequest::Status

This property holds the status of a query.

Access functions:

QGalleryAbstractRequest::Status status () const

Notifier signal:

void statusChanged ( QGalleryAbstractRequest::Status status )

Member Function Documentation

QGalleryQueryModel::QGalleryQueryModel ( QObject * parent = 0 )

Constructs a new query model.

The parent is passed to QAbstractItemModel.

QGalleryQueryModel::QGalleryQueryModel ( QAbstractGallery * gallery, QObject * parent = 0 )

Constructs a new model which queries items from a gallery.

The parent is passed to QAbstractItemModel.

QGalleryQueryModel::~QGalleryQueryModel ()

void QGalleryQueryModel::addColumn ( const QHash<int, QString> & properties )

Adds a column which maps the given properties to a query model.

The column will not be populated until the query is executed.

void QGalleryQueryModel::addColumn ( const QString & property, int role = Qt::DisplayRole )

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.

void QGalleryQueryModel::cancel ()

Cancels a query.

void QGalleryQueryModel::cancelled () [signal]

Signals that the query was cancelled.

void QGalleryQueryModel::clear ()

Clears the results of a query.

int QGalleryQueryModel::columnCount ( const QModelIndex & parent = QModelIndex() ) const

QVariant QGalleryQueryModel::data ( const QModelIndex & index, int role = Qt::DisplayRole ) const

See also setData().

void QGalleryQueryModel::errorChanged () [signal]

Signals that the error and errorString properties have changed.

void QGalleryQueryModel::execute ()

Executes a query.

void QGalleryQueryModel::finished () [signal]

Signals that the query has finished with the given result.

Qt::ItemFlags QGalleryQueryModel::flags ( const QModelIndex & index ) const

QVariant QGalleryQueryModel::headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const

See also setHeaderData().

QModelIndex QGalleryQueryModel::index ( int row, int column, const QModelIndex & parent = QModelIndex() ) const

void QGalleryQueryModel::insertColumn ( int index, const QHash<int, QString> & properties )

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.

void QGalleryQueryModel::insertColumn ( int index, const QString & property, int role = Qt::DisplayRole )

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.

QVariant QGalleryQueryModel::itemId ( const QModelIndex & index ) const

Returns the ID of the item at index.

QString QGalleryQueryModel::itemType ( const QModelIndex & index ) const

Returns the type of the item at index.

QUrl QGalleryQueryModel::itemUrl ( const QModelIndex & index ) const

Returns the URL of the item at index.

QModelIndex QGalleryQueryModel::parent ( const QModelIndex & index ) const

void QGalleryQueryModel::removeColumn ( int index )

Removes the column at index from a query model.

QHash<int, QString> QGalleryQueryModel::roleProperties ( int column ) const

Returns the meta-data properties which a column maps to roles.

See also setRoleProperties().

int QGalleryQueryModel::rowCount ( const QModelIndex & parent = QModelIndex() ) const

bool QGalleryQueryModel::setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole )

See also data().

bool QGalleryQueryModel::setHeaderData ( int section, Qt::Orientation orientation, const QVariant & value, int role = Qt::EditRole )

See also headerData().

void QGalleryQueryModel::setRoleProperties ( int column, const QHash<int, QString> & properties )

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().

void QGalleryQueryModel::statusChanged ( QGalleryAbstractRequest::Status status ) [signal]

Signals that the status of the query has changed.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.