QDBusReply Class
The QDBusReply class stores the reply for a method call to a remote object. More...
Header: | #include <QDBusReply> |
qmake: | QT += dbus |
Since: | Qt 4.2 |
Public Functions
QDBusReply(const int &reply) | |
const int & | error() |
const int & | error() const |
bool | isValid() const |
QDBusReply::Type | value() const |
QDBusReply::Type | operator QDBusReply::Type() const |
QDBusReply<T> & | operator=(const int &reply) |
QDBusReply<T> & | operator=(const QDBusReply<T> &other) |
Detailed Description
The QDBusReply class stores the reply for a method call to a remote object.
A QDBusReply object is a subset of the QDBusMessage object that represents a method call's reply. It contains only the first output argument or the error code and is used by QDBusInterface-derived classes to allow returning the error code as the function's return argument.
It can be used in the following manner:
QDBusReply<QString> reply = interface->call("RemoteMethod"); if (reply.isValid()) // use the returned value useValue(reply.value()); else // call failed. Show an error condition. showError(reply.error());
If the remote method call cannot fail, you can skip the error checking:
QString reply = interface->call("RemoteMethod");
However, if it does fail under those conditions, the value returned by QDBusReply<T>::value() is a default-constructed value. It may be indistinguishable from a valid return value.
QDBusReply objects are used for remote calls that have no output arguments or return values (i.e., they have a "void" return type). Use the isValid() function to test if the reply succeeded.
See also QDBusMessage and QDBusInterface.
Member Function Documentation
QDBusReply::QDBusReply(const int &reply)
Default constructs an instance of QDBusReply.
const int &QDBusReply::error()
const int &QDBusReply::error() const
bool QDBusReply::isValid() const
QDBusReply::Type QDBusReply::value() const
QDBusReply::Type QDBusReply::operator QDBusReply::Type() const
QDBusReply<T> &QDBusReply::operator=(const int &reply)
Copy-assignment operator.
QDBusReply<T> &QDBusReply::operator=(const QDBusReply<T> &other)
Copy-assignment operator.