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  · 

QGalleryAbstractResponse Class Reference

The QGalleryAbstractResponse class provides a base class for responses to gallery requests. More...

 #include <QGalleryAbstractResponse>

Inherits: QObject.

Inherited by: QGalleryResultSet.

This class was introduced in Qt Mobility 1.1.

Public Functions

QGalleryAbstractResponse ( int error, const QString & errorString = QString(), QObject * parent = 0 )
~QGalleryAbstractResponse ()
virtual void cancel ()
int error () const
QString errorString () const
bool isActive () const
bool isIdle () const
virtual bool waitForFinished ( int msecs )
  • 29 public functions inherited from QObject

Signals

void canceled ()
void finished ()
void progressChanged ( int current, int maximum )
void resumed ()

Protected Functions

QGalleryAbstractResponse ( QObject * parent = 0 )
void error ( int error, const QString & errorString = QString() )
void finish ( bool idle = false )
void resume ()
  • 7 protected functions inherited from QObject

Additional Inherited Members

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

Detailed Description

The QGalleryAbstractResponse class provides a base class for responses to gallery requests.

QGalleryAbstractResponse is the interface through which a QAbstractGallery returns a response to a QGalleryAbstractRequest. The interface provides functions to communicate the state of a response to a request, additional classes derived from QGalleryAbstractRequest such as QGalleryResultSet are used to communicate actual results.

New responses start in an active state indicating they have not yet finished. When a response has finished; implementers should call the finish function which will put the response into an inactive state and emit the finished signal. If the idle argument of finish is true then isIdle() will be true on return indicating that the response may return to an active state in order to refresh its results in the future. The resume function will return the response to an active state and emit the resumed signal.

If a response cannot finish successfully then implementers should call the error() function and supply an error code and description. This will finish the request and set values for error() and errorString().

If a request is cancelled it will call cancel() on its response. The base implementation wsets isActive() and isIdle() to false and emits the canceled signal, so implementers will need to override the default implementation to actually cancel any ongoing task or suspend updates before calling the base implementation. If the response can't be canceled synchronously then calling the base implementation should be deferred until the cancelation has completed. Canceling a response should not discard any intermediate results already made available by the response.

Unless a response finishes synchronously and calls finish() or error() from its constructor it must implement the waitForFinished() function to allow clients to block while waiting for the response to finish.

Member Function Documentation

QGalleryAbstractResponse::QGalleryAbstractResponse ( int error, const QString & errorString = QString(), QObject * parent = 0 )

Constructs a new gallery response, for a request that has finished with an error. The optional errorString will describe the error in greater detail.

The parent is passed to QObject.

QGalleryAbstractResponse::QGalleryAbstractResponse ( QObject * parent = 0 ) [protected]

Constructs a new gallery response.

The parent is passed to QObject.

QGalleryAbstractResponse::~QGalleryAbstractResponse ()

Destroys a gallery response.

void QGalleryAbstractResponse::cancel () [virtual]

Cancels an active or idle gallery response.

The default implementation finishes the an active response with the QGalleryAbstractRequest::Canceled result. If the reponse is idle the finished() signal will be re-emitted with idle

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractResponse::canceled () [signal]

Signals that a response was canceled.

This function was introduced in Qt Mobility 1.1.

int QGalleryAbstractResponse::error () const

Returns an identifier describing an error condition encountered by a response.

In the case of no error this will return QGalleryAbstractRequest::NoError.

This function was introduced in Qt Mobility 1.1.

See also QGalleryAbstractRequest::Error and QDocumentGallery::Error.

void QGalleryAbstractResponse::error ( int error, const QString & errorString = QString() ) [protected]

Finalizes a response in response to an error condition.

The error, and errorString are communicated to issuing request.

This function was introduced in Qt Mobility 1.1.

QString QGalleryAbstractResponse::errorString () const

Returns a string describing the cause of an error() in more detail.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractResponse::finish ( bool idle = false ) [protected]

Finalizes a gallery response.

If idle is true the items returned by a response will be monitored for changes and updated as appropriate.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractResponse::finished () [signal]

Signals that a response has finished.

This function was introduced in Qt Mobility 1.1.

bool QGalleryAbstractResponse::isActive () const

Identifies if a response is in an active state.

Returns true if a response is active, and false otherwise.

This function was introduced in Qt Mobility 1.1.

bool QGalleryAbstractResponse::isIdle () const

Identifies if the items returned by a response are being monitored for changes.

Returns true if a response is in an idle state, and false otherwise.

This function was introduced in Qt Mobility 1.1.

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

Signals that the current or maximum progress of a request has changed.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractResponse::resume () [protected]

Returns a response to an active state.

An idle response can call this to indicate it has begun refreshing its contents.

This function was introduced in Qt Mobility 1.1.

void QGalleryAbstractResponse::resumed () [signal]

Signals that an idle response has resumed communications.

This function was introduced in Qt Mobility 1.1.

bool QGalleryAbstractResponse::waitForFinished ( int msecs ) [virtual]

Waits for msecs for the a response to finish.

Returns true if the response 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. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  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. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 43
  4. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 9
Page suivante

Le Qt Labs au hasard

Logo

QMake et au-delà, le retour

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