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  · 

QDBusError Class Reference

The QDBusError class represents an error received from the D-Bus bus or from remote applications found in the bus. More...

 #include <QDBusError>

This class was introduced in Qt 4.2.

Public Types

enum ErrorType { NoError, Other, Failed, NoMemory, ..., UnknownObject }

Public Functions

bool isValid () const
QString message () const
QString name () const
ErrorType type () const

Static Public Members

QString errorString ( ErrorType error )

Detailed Description

The QDBusError class represents an error received from the D-Bus bus or from remote applications found in the bus.

When dealing with the D-Bus bus service or with remote applications over D-Bus, a number of error conditions can happen. This error conditions are sometimes signalled by a returned error value or by a QDBusError.

C++ and Java exceptions are a valid analogy for D-Bus errors: instead of returning normally with a return value, remote applications and the bus may decide to throw an error condition. However, the QtDBus implementation does not use the C++ exception-throwing mechanism, so you will receive QDBusErrors in the return reply (see QDBusReply::error()).

QDBusError objects are used to inspect the error name and message as received from the bus and remote applications. You should not create such objects yourself to signal error conditions when called from D-Bus: instead, use QDBusMessage::createError() and QDBusConnection::send().

See also QDBusConnection::send(), QDBusMessage, and QDBusReply.

Member Type Documentation

enum QDBusError::ErrorType

In order to facilitate verification of the most common D-Bus errors generated by the D-Bus implementation and by the bus daemon itself, QDBusError can be compared to a set of pre-defined values:

ConstantValueDescription
QDBusError::NoError0QDBusError is invalid (i.e., the call succeeded)
QDBusError::Other1QDBusError contains an error that is one of the well-known ones
QDBusError::Failed2The call failed (org.freedesktop.DBus.Error.Failed)
QDBusError::NoMemory3Out of memory (org.freedesktop.DBus.Error.NoMemory)
QDBusError::ServiceUnknown4The called service is not known (org.freedesktop.DBus.Error.ServiceUnknown)
QDBusError::NoReply5The called method did not reply within the specified timeout (org.freedesktop.DBus.Error.NoReply)
QDBusError::BadAddress6The address given is not valid (org.freedesktop.DBus.Error.BadAddress)
QDBusError::NotSupported7The call/operation is not supported (org.freedesktop.DBus.Error.NotSupported)
QDBusError::LimitsExceeded8The limits allocated to this process/call/connection exceeded the pre-defined values (org.freedesktop.DBus.Error.LimitsExceeded)
QDBusError::AccessDenied9The call/operation tried to access a resource it isn't allowed to (org.freedesktop.DBus.Error.AccessDenied)
QDBusError::NoServer10Documentation doesn't say what this is for (org.freedesktop.DBus.Error.NoServer)
QDBusError::Timeout11Documentation doesn't say what this is for or how it's used (org.freedesktop.DBus.Error.Timeout)
QDBusError::NoNetwork12Documentation doesn't say what this is for (org.freedesktop.DBus.Error.NoNetwork)
QDBusError::AddressInUse13QDBusServer tried to bind to an address that is already in use (org.freedesktop.DBus.Error.AddressInUse)
QDBusError::Disconnected14The call/process/message was sent after QDBusConnection disconnected (org.freedesktop.DBus.Error.Disconnected)
QDBusError::InvalidArgs15The arguments passed to this call/operation are not valid (org.freedesktop.DBus.Error.InvalidArgs)
QDBusError::UnknownMethod16The method called was not found in this object/interface with the given parameters (org.freedesktop.DBus.Error.UnknownMethod)
QDBusError::TimedOut17Documentation doesn't say... (org.freedesktop.DBus.Error.TimedOut)
QDBusError::InvalidSignature18The type signature is not valid or compatible (org.freedesktop.DBus.Error.InvalidSignature)
QDBusError::UnknownInterface19The interface is not known
QDBusError::InternalError20An internal error occurred (com.trolltech.QtDBus.Error.InternalError)
QDBusError::InvalidObjectPath23The object path provided is invalid.
QDBusError::InvalidService22The service requested is invalid.
QDBusError::InvalidMember25The member is invalid.
QDBusError::InvalidInterface24The interface is invalid.
QDBusError::UnknownObject21The remote object could not be found.

Member Function Documentation

QString QDBusError::errorString ( ErrorType error ) [static]

Returns the error name associated with error condition error.

This function was introduced in Qt 4.3.

bool QDBusError::isValid () const

Returns true if this is a valid error condition (i.e., if there was an error), otherwise false.

QString QDBusError::message () const

Returns the message that the callee associated with this error. Error messages are implementation defined and usually contain a human-readable error code, though this does not mean it is suitable for your end-users.

QString QDBusError::name () const

Returns this error's name. Error names are similar to D-Bus Interface names, like org.freedesktop.DBus.InvalidArgs.

See also type().

ErrorType QDBusError::type () const

Returns this error's ErrorType.

See also ErrorType.

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 64
  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. 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
  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. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment fermer une application

Le Qt Developer Network est un r�seau de d�veloppeurs Qt anglophone, o� ils peuvent partager leur exp�rience sur le framework. 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 4.7
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