[PyKDE] Re: Threading problem with PyQt4 and Macosx

Phil Thompson phil at riverbankcomputing.co.uk
Sun Feb 25 16:19:53 GMT 2007


On Sunday 25 February 2007 3:00 pm, Michael Guntsche wrote:
> On Feb 25, 2007, at 15:12, Phil Thompson wrote:
> > Not to my knowledge.
> >
> > Phil
>
> So both examples here are working on your system then?

No - but my knowledge doesn't tell me why not. However, I've just had an 
idea...

A proxy QObject is created for the Python callable slot. The thread affinity 
of the proxy will be the thread that the connect() is executed in.

If the connect is done in your __init__() method the underlying events are 
sent to the main thread's event loop which you are processing and everything 
works.

If the connect is done in your run() method the underlying events are sent to 
the sub-thread where you don't have an event loop running.

It seems that I need to work out how to find the thread affinity of a Python 
object...

Phil




More information about the PyQt mailing list