PDA

View Full Version : [SOLVED] Python: PyQt & Threading



Sailor5
January 28th, 2011, 12:48 PM
Greetings!

So after a button has been pushed the appropriate deferred gets executed. At the end of such I then need to execute another deferred as a separate thread so as to carry on with more jobs and still have the UI working.


T3 = Thread(target=Compile(self,info,info2))
T3.start()However after spawning the new thread the UI freezes. Only to come back once the thread has finished. I thought a new thread would run separately? So I would be able to keep performing tasks and have the user interface still working. However that doesn't seem to be the case.

Thanks bye!

lavinog
February 1st, 2011, 07:08 AM
Can you post the full code?

Sailor5
February 1st, 2011, 11:34 AM
I linked this thread in IRC and got the fix. Need to pass arguments via arg=
T3 = Thread(target=deferred,args=(self,arg1,arg2,))
T3.start()