Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QGalleryResultSet Class Reference

The QGalleryResultSet class provides a gallery response which returns the results of a query. More...

 #include <QGalleryResultSet>

Inherits QGalleryAbstractResponse.

Public Functions

QGalleryResultSet ( QObject * parent = 0 )
~QGalleryResultSet ()
virtual int currentIndex () const = 0
virtual bool fetch ( int index ) = 0
virtual bool fetchFirst ()
virtual bool fetchLast ()
virtual bool fetchNext ()
virtual bool fetchPrevious ()
virtual bool isValid () const
virtual int itemCount () const = 0
virtual QVariant itemId () const = 0
virtual QString itemType () const = 0
virtual QUrl itemUrl () const = 0
virtual QVariant metaData ( int key ) const = 0
virtual QGalleryProperty::Attributes propertyAttributes ( int key ) const = 0
virtual int propertyKey ( const QString & property ) const = 0
virtual QVariant::Type propertyType ( int key ) const = 0
virtual QList<QGalleryResource> resources () const
virtual bool setMetaData ( int key, const QVariant & value ) = 0

Signals

void currentIndexChanged ( int index )
void currentItemChanged ()
void itemsInserted ( int index, int count )
void itemsMoved ( int from, int to, int count )
void itemsRemoved ( int index, int count )
void metaDataChanged ( int index, int count, const QList<int> & keys )

Additional Inherited Members

Detailed Description

The QGalleryResultSet class provides a gallery response which returns the results of a query.

Implementations of QGalleryResultSet are used to return a result set in response to a QGalleryAbstractRequest. A QGalleryResultSet provides functions for accessing identifying information and meta-data of items queried from a gallery.

Only one item in a result set can be accessed at a time, so before information about an item can be accessed it must be selected using one of the fetch() functions. When a new index is selected the result set will emit the currentIndexChanged() signal, and when the currently selected item changes the currentItemChanged() signal will be emitted. If the currentIndex() contains a gallery item isValid() will return true, otherwise it will return false. Information identifying the current item in a result set can be accessed using the itemId(), itemUrl() and itemType() functions.

For each meta-data property that can be addressed by a result set it will provide a unique key which queried by passing the property's name to the propertyKey() function. Passing this key to the metaData() function will return the current item's value for that property. Some result sets may contain editable meta-data values which can be changed using the setMetaData() function. The attributes of a meta-data property such as whether it's writable can be queried from propertyAttributes() and the type of value that will returned by metaData() can be queried using propertyType().

Whenever items are added or removed from a result set the itemsInserted() and itemsRemoved() signals will be emitted identifying where and how many items were changed. If the meta-data of one or more items in a result set changes the metaDataChanged() signal will be emitted.

Member Function Documentation

QGalleryResultSet::QGalleryResultSet ( QObject * parent = 0 )

Constructs a new result set.

The parent is passed to QGalleryAbstractResponse.

QGalleryResultSet::~QGalleryResultSet ()

Destroys a result set.

int QGalleryResultSet::currentIndex () const [pure virtual]

Returns the index of the item a result set currently positioned on.

See also fetch().

void QGalleryResultSet::currentIndexChanged ( int index ) [signal]

Signals that a result set has been repositioned on a new index.

void QGalleryResultSet::currentItemChanged () [signal]

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

bool QGalleryResultSet::fetch ( int index ) [pure virtual]

Moves the current position of a result set to an arbitrary index.

Returns true if the result set is positioned on a valid item on return; otherwise returns false.

bool QGalleryResultSet::fetchFirst () [virtual]

Moves the current position of the result set to the first item in the set.

Returns true if the result set is positioned on a valid item on return; otherwise returns false.

bool QGalleryResultSet::fetchLast () [virtual]

Moves the current position of the result set to the last item in the set.

Returns true if the result set is positioned on a valid item on return; otherwise returns false.

bool QGalleryResultSet::fetchNext () [virtual]

Moves the current position of the result set to the next item in the set.

Returns true if the result set is positioned on a valid item on return; otherwise returns false.

bool QGalleryResultSet::fetchPrevious () [virtual]

Moves the current position of the result set to the previous item in the set.

Returns true if the result set is positioned on a valid item on return; otherwise returns false.

bool QGalleryResultSet::isValid () const [virtual]

Returns true if a result set is currently positioned on a valid item; otherwise returns false.

See also currentIndex().

int QGalleryResultSet::itemCount () const [pure virtual]

Returns the number of items in a result set.

QVariant QGalleryResultSet::itemId () const [pure virtual]

Returns the ID of the item a result set is currently positioned on.

See also currentIndex().

QString QGalleryResultSet::itemType () const [pure virtual]

Returns the type of the item a result set is currently positioned on.

See also currentIndex().

QUrl QGalleryResultSet::itemUrl () const [pure virtual]

Returns the URL of the item a result set is currently positioned on.

See also currentIndex() and resources().

void QGalleryResultSet::itemsInserted ( int index, int count ) [signal]

Signals that count items have been inserted into a result set at index.

void QGalleryResultSet::itemsMoved ( int from, int to, int count ) [signal]

Signals that count items have been moved from an existing index to a new index.

void QGalleryResultSet::itemsRemoved ( int index, int count ) [signal]

Signals that count items have been removed from a result set at index.

QVariant QGalleryResultSet::metaData ( int key ) const [pure virtual]

Returns the meta-data value of the current item for key.

See also setMetaData().

void QGalleryResultSet::metaDataChanged ( int index, int count, const QList<int> & keys ) [signal]

Signals that the meta-data identified by keys of count items starting at index has changed.

QGalleryProperty::Attributes QGalleryResultSet::propertyAttributes ( int key ) const [pure virtual]

Returns the attributes of the property identified by key.

int QGalleryResultSet::propertyKey ( const QString & property ) const [pure virtual]

Returns a positive integer key for a property name, or a negative integer if the property name is invalid.

QVariant::Type QGalleryResultSet::propertyType ( int key ) const [pure virtual]

Returns the type of the property identified by key.

QList<QGalleryResource> QGalleryResultSet::resources () const [virtual]

Returns the resources of the item of a result set is currently positioned on.

The default implementation returns a single resource with the URL of the current item, or an empty list if the current item doesn't have a valid URL.

See also currentIndex() and itemUrl().

bool QGalleryResultSet::setMetaData ( int key, const QVariant & value ) [pure virtual]

Sets the meta-data value of the current item for key.

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

See also metaData().

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.

[0]; s.parentNode.insertBefore(ga, s); })();
Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 88
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 29
  5. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
Page suivante

Le Qt Labs au hasard

Logo

Sémantique d'ordonnancement mémoire et opérations atomiques dans Qt

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.1
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web