PySide6.QtDBus.QDBusPendingCallWatcher¶
- class QDBusPendingCallWatcher¶
- The - QDBusPendingCallWatcherclass provides a convenient way for waiting for asynchronous replies.- Details- Warning - This section contains snippets that were automatically translated from C++ to Python and may contain errors. - The - QDBusPendingCallWatcherprovides the- finished()signal that will be emitted when a reply arrives.- It is usually used like the following example: - async = iface.asyncCall("RemoteMethod", value1, value2) watcher = QDBusPendingCallWatcher(async, self) watcher.finished.connect(this, DBus_PendingCall_Interface.callFinishedSlot) - Note that it is not necessary to keep the original - QDBusPendingCallobject around since- QDBusPendingCallWatcherinherits from that class too.- The slot connected to by the above code could be something similar to the following: - def callFinishedSlot(self, call): QByteArray> reply = call if reply.isError(): showError() else: text = reply.argumentAt<0>() data = reply.argumentAt<1>() showReply(text, data) call.deleteLater() - Note the use of - QDBusPendingReplyto validate the argument types in the reply. If the reply did not contain exactly two arguments (one string and one QByteArray),- isError()will return true.- See also - QDBusPendingReply- Synopsis¶- Methods¶- def - __init__()
 - Signals¶- def - finished()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - __init__(call[, parent=None])¶
- Parameters:
- call – - QDBusPendingCall
- parent – - QObject
 
 
 - Creates a - QDBusPendingCallWatcherobject to watch for replies on the asynchronous pending call- calland sets this object’s parent to- parent.- finished([self=None])¶
- Parameters:
- self – - QDBusPendingCallWatcher
 
 - This signal is emitted when the pending call has finished and its reply is available. The - selfparameter 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.