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  · 

QGalleryAbstractRequest Class Reference

The QGalleryAbstractRequest class provides a base class for gallery requests. More...

 #include <QGalleryAbstractRequest>

Inherits: QObject.

Inherited by: QGalleryItemRequest, QGalleryQueryRequest, and QGalleryTypeRequest.

This class was introduced in Qt Mobility 1.1.

Public Types

enum RequestError { NoError, NoGallery, NotSupported, GalleryError }
enum RequestType { QueryRequest, ItemRequest, TypeRequest }
enum State { Inactive, Active, Canceling, Canceled, ..., Error }

Properties

  • 1 property inherited from QObject

Public Functions

QGalleryAbstractRequest ( RequestType type, QObject * parent = 0 )
QGalleryAbstractRequest ( QAbstractGallery * gallery, RequestType type, QObject * parent = 0 )
~QGalleryAbstractRequest ()
int currentProgress () const
int error () const
QString errorString () const
QAbstractGallery * gallery () const
bool isSupported () const
int maximumProgress () const
void setGallery ( QAbstractGallery * gallery )
State state () const
RequestType type () const
bool waitForFinished ( int msecs )
  • 29 public functions inherited from QObject

Public Slots

void cancel ()
void clear ()
void execute ()
  • 1 public slot inherited from QObject

Signals

void canceled ()
void error ( int error, const QString & errorString )
void errorChanged ()
void finished ()
void galleryChanged ()
void progressChanged ( int current, int maximum )
void stateChanged ( QGalleryAbstractRequest::State state )
void supportedChanged ()

Protected Functions

virtual void setResponse ( QGalleryAbstractResponse * response ) = 0
  • 7 protected functions inherited from QObject

Additional Inherited Members

  • 1 public variable inherited from QObject
  • 4 static public members inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QGalleryAbstractRequest class provides a base class for gallery requests.

Gallery requests are the interface through which clients can interact with a gallery to execute queries or perform actions. QAbstractGalleryRequest manages executing requests against a gallery and reporting the state of responses.

In order to execute a request it is first necessary to assign the gallery to the request. If the request is supported by the gallery the supported property will be true, otherwise if the request is not supported or no gallery is assigned to the request supported will be false.

Once a request has been assigned a gallery and its own arguments it can be executed. As requests are asynchronous results will not be available immediately, instead the request will go into an Active state until it is finished. If the request is successful the finished() signal will be emitted and if not the error() signal will be emitted, in both cases the stateChanged() signal will be emitted with the new state of the request.

Active requests can be canceled by calling the cancel() function. Canceling a request can also be an asynchronous action and does not always prevent a request from finishing successfully such as when the earliest possible point to interrupt a request is on completion. If a canceled request isn't aborted immediately it will go into the Canceling state until it is aborted and enters the Canceled state or succeeds and enters the Finished state.

Some requests support automatically updating their results in response to changes in their source data or some other event. A request that will provide these sort of updates will enter the Idle state upon finishing its initial request. From the Idle state a request may return to the Active state itself to refresh its results or update it results immeditately if a a new query is not required. Cancelling an idle request will put it into the Finished state and prevent future updates.

While requests are asynchronous it is possible to use them in a synchronous manner by using the waitForFinished() function to block until the request has finished.

Member Type Documentation

enum QGalleryAbstractRequest::RequestError

ConstantValueDescription
QGalleryAbstractRequest::NoError0No error.
QGalleryAbstractRequest::NoGallery1No gallery found.
QGalleryAbstractRequest::NotSupported2Request is not supported.
QGalleryAbstractRequest::GalleryError100The gallery is wrong or corrupt.

enum QGalleryAbstractRequest::RequestType

Identifies the type of a request.

ConstantValueDescription
QGalleryAbstractRequest::QueryRequest0The request is a QGalleryQueryRequest.
QGalleryAbstractRequest::ItemRequest1The request is a QGalleryItemRequest.
QGalleryAbstractRequest::TypeRequest2The request is a QGalleryTypeRequest

enum QGalleryAbstractRequest::State

Identifies the state of a gallery request.

ConstantValueDescription
QGalleryAbstractRequest::Inactive0The request has not been executed.
QGalleryAbstractRequest::Active1The request is currently executing.
QGalleryAbstractRequest::Canceling2The request was canceled, but hasn't yet reached the Canceled state.
QGalleryAbstractRequest::Canceled3The request was canceled.
QGalleryAbstractRequest::Idle4The request has finished, but may return to the active state in response to an internal event.
QGalleryAbstractRequest::Finished5The request is finished.
QGalleryAbstractRequest::Error6The request runs into an error.

Property Documentation

currentProgress : const int

This property holds the current progress of a request.

This property was introduced in Qt Mobility 1.1.

Access functions:

int currentProgress () const

Notifier signal:

void progressChanged ( int current, int maximum )

error : const int

This property holds the error encountered by an unsuccessful request.

Common errors are defined in Error, more specific errors are defined by the gallery implementations such as in QDocumentGallery::Error.

This property was introduced in Qt Mobility 1.1.

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.

This property was introduced in Qt Mobility 1.1.

Access functions:

QString errorString () const

Notifier signal:

void errorChanged ()

gallery : QAbstractGallery *

This property holds the gallery service a request acts on.

This property was introduced in Qt Mobility 1.1.

Access functions:

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

Notifier signal:

void galleryChanged ()

maximumProgress : const int

This property holds the maximum value of currentProgress.

This property was introduced in Qt Mobility 1.1.

Access functions:

int maximumProgress () const

Notifier signal:

void progressChanged ( int current, int maximum )

state : const State

This property holds the state of a request.

This property was introduced in Qt Mobility 1.1.

Access functions:

State state () const

Notifier signal:

void stateChanged ( QGalleryAbstractRequest::State state )

supported : const bool

This property holds whether a request is supported by its current gallery.

This property was introduced in Qt Mobility 1.1.

Access functions:

bool isSupported () const

Notifier signal:

void supportedChanged ()

Member Function Documentation

QGalleryAbstractRequest::QGalleryAbstractRequest ( RequestType type, QObject * parent = 0 )

Constructs a new gallery type request.

The parent is passed to QObject.

This function was introduced in Qt Mobility 1.1.

QGalleryAbstractRequest::QGalleryAbstractRequest ( QAbstractGallery * gallery, RequestType type, QObject * parent = 0 )

Constructs a new type request for the given gallery.

The parent is passed to QObject.

This function was introduced in Qt Mobility 1.1.

QGalleryAbstractRequest::~QGalleryAbstractRequest ()

Destroys a gallery request.

void QGalleryAbstractRequest::cancel () [slot]

Cancels the execution of a request. If the request is idle this will stop any future updates.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractRequest::canceled () [signal]

Signals that a request was canceled before it could finish.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractRequest::clear () [slot]

Clears the results of a request.

If the request is active or idle it will be canceled.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractRequest::errorChanged () [signal]

Signals that the error and errorString properties have changed.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractRequest::execute () [slot]

Executes a request.

Note: A valid gallery must be set before a request can be executed.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractRequest::finished () [signal]

Signals that a request has finished.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractRequest::galleryChanged () [signal]

Signals that the value of gallery has changed.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractRequest::progressChanged ( int current, int maximum ) [signal]

Signals that the current or maximum progress value has changed.

This function was introduced in Qt Mobility 1.1.

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

Sets the response to an executed request.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractRequest::stateChanged ( QGalleryAbstractRequest::State state ) [signal]

Signals that the state of a request has changed.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractRequest::supportedChanged () [signal]

Signals the supported property has changed.

This function was introduced in Qt Mobility 1.1.

RequestType QGalleryAbstractRequest::type () const

Returns the type of a request.

This function was introduced in Qt Mobility 1.1.

bool QGalleryAbstractRequest::waitForFinished ( int msecs )

Waits for msecs for the a request to finish.

Returns true if the request has finished on return, and returns false if the wait time expires or the request is inactive or idle.

This function was introduced in Qt Mobility 1.1.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 69
  2. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 27
  3. Une nouvelle ère d'IHM 3D pour les automobiles, un concept proposé par Digia et implémenté avec Qt 3
  4. Qt Creator 2.5 est sorti en beta, l'EDI supporte maintenant plus de fonctionnalités de C++11 2
  5. Vingt sociétés montrent leurs décodeurs basés sur Qt au IPTV World Forum, en en exploitant diverses facettes (déclaratif, Web, widgets) 0
  6. PySide devient un add-on Qt et rejoint le Qt Project et le modèle d'open gouvernance 1
  7. Thread travailleur avec Qt en utilisant les signaux et les slots, un article de Christophe Dumez traduit par Thibaut Cuvelier 1
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 101
  2. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 51
  3. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 69
  4. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 27
  5. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 11
Page suivante
  1. Linus Torvalds : le "C++ est un langage horrible", en justifiant le choix du C pour le système de gestion de version Git 100
  2. Comment prendre en compte l'utilisateur dans vos applications ? Pour un développeur, « 90 % des utilisateurs sont des idiots » 229
  3. Quel est LE livre que tout développeur doit lire absolument ? Celui qui vous a le plus marqué et inspiré 96
  4. Apple cède et s'engage à payer des droits à Nokia, le conflit des brevets entre les deux firmes s'achève 158
  5. Nokia porte à nouveau plainte contre Apple pour violation de sept nouveaux brevets 158
  6. Quel est le code dont vous êtes le plus fier ? Pourquoi l'avez-vous écrit ? Et pourquoi vous a-t-il donné autant de satisfaction ? 83
  7. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 101
Page suivante

Le Qt Labs au hasard

Logo

Le moteur de rendu OpenGL

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.2
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