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  · 

QDSAction Class Reference
[QtBaseModule]

The QDSAction class provides an interface for requesting Qt Extended Data Sharing (QDS) services. More...

    #include <QDSAction>

Inherits QObject.

Public Types

  • enum ResponseCode { Invalid, Complete, CompleteData, Error }

Public Functions

  • QDSAction ( QObject * parent = 0 )
  • QDSAction ( const QDSAction & other )
  • QDSAction ( const QString & name, const QString & service, QObject * parent = 0 )
  • QDSAction ( const QDSServiceInfo & serviceInfo, QObject * parent = 0 )
  • QString errorMessage () const
  • int exec ()
  • int exec ( const QDSData & requestData, const QByteArray & auxiliary = QByteArray() )
  • QUniqueId id () const
  • bool invoke ()
  • bool invoke ( const QDSData & requestData, const QByteArray & auxiliary = QByteArray() )
  • bool isActive () const
  • bool isAvailable () const
  • bool isValid () const
  • QDSData responseData () const
  • const QDSServiceInfo & serviceInfo () const
  • const QDSAction & operator= ( const QDSAction & other )
  • 29 public functions inherited from QObject

Signals

  • void error ( const QUniqueId & actionId, const QString & message )
  • void response ( const QUniqueId & actionId )
  • void response ( const QUniqueId & actionId, const QDSData & responseData )

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QDSAction class provides an interface for requesting Qt Extended Data Sharing (QDS) services.

Applications can use the QDSAction class to make a request for a QDS service. The request can be made either synchronously (using QDSAction::exec()) or asynchronously (using QDSAction::invoke()).

See also QDSServiceInfo and Qt Extended Data Sharing (QDS).


Member Type Documentation

enum QDSAction::ResponseCode

This enum describes response codes for synchronous requests.

ConstantValueDescription
QDSAction::Invalid0Response code has not been set.
QDSAction::Complete1The request was processed correctly.
QDSAction::CompleteData2The request was processed correctly, and response data was received.
QDSAction::Error3An error occured, use QDSAction::errorMessage() to view the error message.


Member Function Documentation

QDSAction::QDSAction ( QObject * parent = 0 )

Constructs an empty QDSAction object and attaches it to parent.

QDSAction::QDSAction ( const QDSAction & other )

Constructs a deep copy of other.

QDSAction::QDSAction ( const QString & name, const QString & service, QObject * parent = 0 )

Constructs a QDSAction object for the QDS service name and the Qt Extended service service. The action is attached to parent.

QDSAction::QDSAction ( const QDSServiceInfo & serviceInfo, QObject * parent = 0 )

Constructs a QDSAction object for the service described in serviceInfo and attaches to parent.

QDSAction::~QDSAction ()

Destroys the action.

void QDSAction::error ( const QUniqueId & actionId, const QString & message )   [signal]

This signal is emitted when an error message message is received for the action identified by actionId.

QString QDSAction::errorMessage () const

Returns any error message generated during the request. Errors are reported from either QDSAction or the provider application, and are reported through QDSData::error() or the return value of QDSData::exec(). If no error has been reported a null string will be returned.

int QDSAction::exec ()

Synchronously performs the QDS service request. The return value provides the result of the request, see QDSAction::ResponseCode.

This method should only be used for QDS services which don't have request data, as discussed in QDSServiceInfo, otherwise an error will be generated.

Warning: This call will block until a response has been received from the QDS service or the request times out.

int QDSAction::exec ( const QDSData & requestData, const QByteArray & auxiliary = QByteArray() )

This is an overloaded member function, provided for convenience.

Synchronously performs the QDS service request with requestData. The return value provides the result of the request, see QDSAction::ResponseCode.

The request may also contain auxiliary data for supplementary information which may be required for the request but does not conceptually belong to requestData.

This method should only be used for QDS services which have request data, as discussed in QDSServiceInfo, otherwise an error will be generated.

Warning: This call will block until the response has been received from the QDS service or the request times out.

QUniqueId QDSAction::id () const

Returns the unique identifier for the QDSAction

bool QDSAction::invoke ()

Asynchronously initiates the QDS service request. Depending on the outcome of the request, the response from the QDS service provider is given by one of QDSData::response() or QDSData::error() signals.

This method should only be used for QDS services which don't have request data, as discussed in QDSServiceInfo, otherwise an error will be generated.

Returns true on successful completion of the request; otherwise returns false.

bool QDSAction::invoke ( const QDSData & requestData, const QByteArray & auxiliary = QByteArray() )

This is an overloaded member function, provided for convenience.

Asynchronously initiates the QDS service request with requestData. Depending on the outcome of the request, the response from the QDS service provider is given by one of QDSData::response() or QDSData::error() signals.

The request may also contain auxiliary data for supplementary information, which may be required for the request but does not conceptually belong to requestData.

This method should only be used for QDS services which have request data, as discussed in QDSServiceInfo, otherwise an error will be generated.

Returns true on successful completion of the request; otherwise returns false.

bool QDSAction::isActive () const

Returns true if the request is still being processed by the QDS service provider; otherwise returns false.

bool QDSAction::isAvailable () const

Returns true if the QDSAction object represents an available QDS service; otherwise returns false. The requirements of an available QDS service are discussed in QDSServiceInfo.

bool QDSAction::isValid () const

Returns true if the QDSAction object represents a valid QDS service; otherwise returns false. The requirements of a valid QDS service are discussed in QDSServiceInfo.

void QDSAction::response ( const QUniqueId & actionId )   [signal]

This signal is emitted when a response is received from the service provider for the action identified by actionId.

void QDSAction::response ( const QUniqueId & actionId, const QDSData & responseData )   [signal]

This is an overloaded member function, provided for convenience.

This signal is emitted when a response is received from the service provider which contains the response data responseData for the action identified by actionId.

QDSData QDSAction::responseData () const

Returns the QDSData generated by the request.

const QDSServiceInfo & QDSAction::serviceInfo () const

Returns the QDSServiceInfo object which describes the QDS service being utilised.

const QDSAction & QDSAction::operator= ( const QDSAction & other )

Makes a deep copy of other and assigns it to this QDSAction object. Returns a reference to this QDSAction object.

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. 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 ? 41
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 6
Page suivante

Le Qt Labs au hasard

Logo

Améliorer les performances de Qt lors du rendu avec plus de SIMD

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 qtextended4.4
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