[PySide] decorator blocking thread signal?

Frank Rueter | OHUfx frank at ohufx.com
Thu Jan 19 23:12:02 CET 2017


Hi Tim,

it seems that the culprit was that ThreadManager was not inheriting from 
QObject.
I didn't think this was needed since Worker was the class that emitted 
the signals.
However, I have since switched to using QRunnable and made ThreadManager 
a descendant of that, and now the signals seem to happen even with the 
decorator.
I still need to do more testing though, just wanted to update this thread.

Cheers,
frank

On 19/01/17 9:50 AM, Frank Rueter | OHUfx wrote:
> Hi Tim,
>
> I dispatch requests by connecting the thread's "start" signal to the 
> worker's method, i.e.:
>     self.workerThread.started.connect(self.worker.myMethod)
>
> I will try and make some time to put together a proper example if the 
> above isn't enough.
>
> Cheers,
> frank
>
> On 19/01/17 8:40 AM, Tim Roberts wrote:
>> Frank Rueter | OHUfx wrote:
>>> this may be a pure python question or QT related, I'm not sure:
>>> I am having trouble with a decorated function not reporting back to
>>> the main thread to drive progress bars etc.
>>> When I remove the decorator and use the respective code directly in
>>> the function in question it all works fine.
>>>
>>> My code looks sort of like this (heavily simplified):
>> I think this may be too heavily simplified.  How does Worker.myMethod
>> get called?  Do you have a "start" or "run" handler within Worker to
>> dispatch requests?
>>
>> There is a fair amount of monkey patching within PySide to make signals
>> and slots work, but it does seem like your example is simple enough.
>>
>
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20170120/d0761591/attachment.html>


More information about the PySide mailing list