[PyQt] PyQt5.3 invokeMethod with Qt.BlockingQueuedConnection and return value question

Phil Thompson phil at riverbankcomputing.com
Sun Dec 14 14:22:57 GMT 2014


On 13/12/2014 5:02 pm, Alan Ezust wrote:
> I am attaching a test case that shows how to use invokeMethod on an 
> object
> in another thread.
> Basically, I want to get the return value of this function, so I set 
> the
> connection type to Qt.BlockingQueuedConnection.
> 
> For some reason the return value of the invokeMethod is always None.
> Is this a bug in PyQt or am I just using invokeMethod in the wrong way?

You need to tell Qt that the slot returns an int by passing the result 
keyword argument to pyqtSlot().

You need to tell invoke() that the method is expected to return an int 
by passing Q_RETURN_ARG(int) after the connection type.

Phil


More information about the PyQt mailing list