![]() |
CopperSpice DBUS
1.7.4
|
Waits for asynchronous replies. More...
Public Signals | |
void | finished (QDBusPendingCallWatcher *self=nullptr) |
Public Methods | |
QDBusPendingCallWatcher (const QDBusPendingCall &call, QObject *parent=nullptr) | |
~QDBusPendingCallWatcher () | |
void | waitForFinished () |
![]() | |
QDBusPendingCall (const QDBusPendingCall &other) | |
~QDBusPendingCall () | |
QDBusError | error () const |
bool | isError () const |
bool | isFinished () const |
bool | isValid () const |
QDBusPendingCall & | operator= (const QDBusPendingCall &other) |
QDBusPendingCall & | operator= (QDBusPendingCall &&other) noexcept |
QDBusMessage | reply () const |
void | swap (QDBusPendingCall &other) noexcept |
void | waitForFinished () |
Additional Inherited Members | |
![]() | |
static QDBusPendingCall | fromCompletedCall (const QDBusMessage &message) |
static QDBusPendingCall | fromError (const QDBusError &error) |
The QDBusPendingCallWatcher class provides a way to wait for asynchronous replies. The finished() signal is emitted when a reply arrives.
The following example shows how to use this class.
The slot method callFinishedSlot referenced in the above call to connect() should be similar to the following. QDBusPendingReply is used to validate the argument types. If the reply does not contain a pair of arguments of the type QSting and QByteArray, then QDBusPendingReply::isError() will return true.
|
explicit |
Creates a QDBusPendingCallWatcher object to watch for replies on the asynchronous pending call and then sets the parent of QDBusPendingCallWatcher to the given parent.
QDBusPendingCallWatcher::~QDBusPendingCallWatcher | ( | ) |
Destroys this object. If this QDBusPendingCallWatcher object was the last reference to the unfinished pending call, the call will be canceled.
|
signal |
This signal is emitted when the pending call has finished and its reply is available. The self parameter is a pointer to the object itself, passed for convenience so that the slot can access the properties and determine the contents of the reply.
void QDBusPendingCallWatcher::waitForFinished | ( | ) |
Suspends the execution of the calling thread until the reply is received and processed. After this function returns, isFinished() should return true, indicating the reply's contents are ready to be processed.