Qt Mobility Reference Documentation

QGalleryQueryRequest Class Reference

The QGalleryQueryRequest class provides a request for a set of items from a gallery. More...

 #include <QGalleryQueryRequest>

Inherits QGalleryAbstractRequest.


Public Types

enum Scope { AllDescendants, DirectDescendants }

Properties


Public Functions

QGalleryQueryRequest ( QObject * parent = 0 )
QGalleryQueryRequest ( QAbstractGallery * gallery, QObject * parent = 0 )
~QGalleryQueryRequest ()
bool autoUpdate () const
int currentIndex () const
QGalleryFilter filter () const
bool first ()
bool isValid () const
int itemCount () const
QVariant itemId () const
QString itemType () const
QUrl itemUrl () const
bool last ()
int limit () const
QVariant metaData ( int key ) const
QVariant metaData ( const QString & property ) const
bool next ()
int offset () const
bool previous ()
QGalleryProperty::Attributes propertyAttributes ( int key ) const
int propertyKey ( const QString & property ) const
QStringList propertyNames () const
QVariant::Type propertyType ( int key ) const
QList<QGalleryResource> resources () const
QGalleryResultSet * resultSet () const
QVariant rootItem () const
QString rootType () const
QGalleryQueryRequest::Scope scope () const
bool seek ( int index, bool relative = false )
void setAutoUpdate ( bool enabled )
void setFilter ( const QGalleryFilter & filter )
void setLimit ( int limit )
bool setMetaData ( int key, const QVariant & value )
bool setMetaData ( const QString & property, const QVariant & value )
void setOffset ( int offset )
void setPropertyNames ( const QStringList & names )
void setRootItem ( const QVariant & itemId )
void setRootType ( const QString & itemType )
void setScope ( QGalleryQueryRequest::Scope scope )
void setSortPropertyNames ( const QStringList & names )
QStringList sortPropertyNames () const

Signals

void currentItemChanged ()
void resultSetChanged ( QGalleryResultSet * resultSet )

Reimplemented Protected Functions

virtual void setResponse ( QGalleryAbstractResponse * response )

Additional Inherited Members


Detailed Description

The QGalleryQueryRequest class provides a request for a set of items from a gallery.


Member Type Documentation

enum QGalleryQueryRequest::Scope

Identifies the scope of query.

ConstantValueDescription
QGalleryQueryRequest::AllDescendants0The query will return all descendents of the scope item.
QGalleryQueryRequest::DirectDescendants1The query will return only direct descendents of the scope item.

Property Documentation

autoUpdate : bool

This property holds whether a the results of a request should be updated after a request has finished.

If this is true the request will go into the Idle state when the request has finished rather than returning to Inactive.

Access functions:

bool autoUpdate () const
void setAutoUpdate ( bool enabled )

currentIndex : int

This property holds the index of current item.

Access functions:

int currentIndex () const
bool seek ( int index, bool relative = false )

Notifier signal:

void currentItemChanged ()

filter : QGalleryFilter

This property holds a filter identifying the items a request should return.

If no filter is set the results of the request will be determined by the rootType and rootItem properties.

Access functions:

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

itemId : const QVariant

This property holds the ID of the current item.

Access functions:

QVariant itemId () const

Notifier signal:

void currentItemChanged ()

itemType : const QString

This property holds he type of the current item.

Access functions:

QString itemType () const

Notifier signal:

void currentItemChanged ()

itemUrl : const QUrl

This property holds the URL of the current item.

Access functions:

QUrl itemUrl () const

Notifier signal:

void currentItemChanged ()

limit : int

This property holds the maximimum 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 )

propertyNames : QStringList

This property holds a list of names of meta-data properties a request should return values for.

Access functions:

QStringList propertyNames () const
void setPropertyNames ( const QStringList & names )

resources : const QList<QGalleryResource>

This property holds the resources of the current item.

Access functions:

QList<QGalleryResource> resources () const

Notifier signal:

void currentItemChanged ()

rootItem : QVariant

This property holds the ID of an item the query should return the descendents of.

Access functions:

QVariant rootItem () const
void setRootItem ( const QVariant & itemId )

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 all descendants of the rootItem should be returned by a request or just the direct descendants.

Access functions:

QGalleryQueryRequest::Scope scope () const
void setScope ( QGalleryQueryRequest::Scope scope )

sortPropertyNames : QStringList

This property holds a list of names of meta-data properties a request should sort its results 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 )

valid : const bool

This property holds whether the result set is currently positioned on a valid item.

Access functions:

bool isValid () const

Notifier signal:

void currentItemChanged ()

Member Function Documentation

QGalleryQueryRequest::QGalleryQueryRequest ( QObject * parent = 0 )

Constructs a new gallery query request.

The parent is passed to QObject.

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

Contructs a new query request for the given gallery.

The parent is passed to QObject.

QGalleryQueryRequest::~QGalleryQueryRequest ()

Destroys a gallery query request.

void QGalleryQueryRequest::currentItemChanged () [signal]

Signals that the item the result set is positioned on has changed.

bool QGalleryQueryRequest::first ()

Seeks to the first item in the result set.

Returns true if the position of the result set is valid after the seek; and false otherwise.

int QGalleryQueryRequest::itemCount () const

Returns the number of items returned by a query.

bool QGalleryQueryRequest::last ()

Seeks to the last item in the result set.

Returns true if the position of the result set is valid after the seek; and false otherwise.

QVariant QGalleryQueryRequest::metaData ( int key ) const

Returns the value of a meta-data property identified by key for the current item.

See also setMetaData().

QVariant QGalleryQueryRequest::metaData ( const QString & property ) const

Returns the value of a meta-data property for the current item.

bool QGalleryQueryRequest::next ()

Seeks to the next item in the result set.

Returns true if the position of the result set is valid after the seek; and false otherwise.

bool QGalleryQueryRequest::previous ()

Seeks to the previous item in the result set.

Returns true if the position of the result set is valid after the seek; and false otherwise.

QGalleryProperty::Attributes QGalleryQueryRequest::propertyAttributes ( int key ) const

Returns the attributes of the property identified by key.

int QGalleryQueryRequest::propertyKey ( const QString & property ) const

Returns the key of property.

QVariant::Type QGalleryQueryRequest::propertyType ( int key ) const

Returns the type of the property identified by key.

QGalleryResultSet * QGalleryQueryRequest::resultSet () const

Returns the result set containing the results of a query.

void QGalleryQueryRequest::resultSetChanged ( QGalleryResultSet * resultSet ) [signal]

Signals that the resultSet containing the results of a query have changed.

bool QGalleryQueryRequest::setMetaData ( int key, const QVariant & value )

Sets the value of a meta-data property identified by key for the current item.

Returns true if the value was changed; otherwise returns false.

See also metaData().

bool QGalleryQueryRequest::setMetaData ( const QString & property, const QVariant & value )

Sets the

ConstantValueDescription
QGalleryQueryRequest::of?a meta-data property for the current item.

Returns true if the value was changed; otherwise returns false.

void QGalleryQueryRequest::setResponse ( QGalleryAbstractResponse * response ) [virtual protected]

Reimplemented from QGalleryAbstractRequest::setResponse().

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.