[PyQt] How to process QDBusPendingCallWatcher results?

Phil Thompson phil at riverbankcomputing.com
Mon Aug 13 17:52:24 BST 2012


On Mon, 13 Aug 2012 11:46:19 -0400, Evade Flow <evadeflow at gmail.com>
wrote:
> I noticed that, too, and was a little surprised it worked anyway.

The pyqtSlot() call is being ignored.

> But
> shouldn't it be:
> 
>     @QtCore.pyqtSlot(QtDBus.QDBusPendingCallWatcher)
>     def callFinishedSlot(self, call):

That would work but, as QDBusPendingCallWatcher is a sub-class of
QDBusPendingCall and the slot only uses methods of the latter, then the
class is more reusable if you use the latter.

> When I remove it completely, I get:
> 
>     TypeError: callFinishedSlot() takes exactly 2 arguments (1 given)

Sounds like you removed the argument rather than the decorator itself.

Phil


More information about the PyQt mailing list