defining and calling QML functions directly from Python

Stefan Seefeld stefan at seefeld.name
Thu Sep 23 21:33:33 BST 2021


...and yet another follow-up:

as I mentioned, I'm interacting with the main application from an 
attached Python interpreter, which - of course - runs in its own thread, 
to let the main thread take care of the Qt event loop.

Looking at the PyQt5 code, I noticed that the implementation of the 
method call  (in the `pyqtMethodProxy_call()` function in 
`qpycore_pyqtmethodproxy.cpp`) calls `method.invoke()` without 
specifying a connection-type. This means the the `auto` connection-type 
will be chosen, which results in the `queued` connection-type to be 
chosen, given that I'm calling this from a secondary thread. And of 
course, that will fail...

Thus my question: what is the reason for the above to not explicitly 
specify the `direct` connection-type argument in the `invoke()` call, 
given that the `MethodProxy` Python type will always use this as direct 
call, and thus will fail when used from non-primary threads ?


Stefan
-- 

       ...ich hab' noch einen Koffer in Berlin...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210923/9831fe56/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .signature.png
Type: image/png
Size: 2754 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210923/9831fe56/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stefan.vcf
Type: text/x-vcard
Size: 4 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210923/9831fe56/attachment.vcf>


More information about the PyQt mailing list