[PySide] Signals and recursion
me at the-compiler.org
Sat Sep 5 18:46:16 CEST 2020
On Tue, Sep 01, 2020 at 11:51:30AM +0300, Safa Alfulaij wrote:
> I have an object with a notifiable property "value".
> I also have 1000+ instances, each has the previous object's property signal
> connected to it's slot.
> In my testing, I exceed the recursion depth at around object 200.
> It seems that each "emit" pauses the execution, goes to the receiver to
> emit, and so on, which creates new stack frames.
> Any way to "solve" this? Thanks!
Your snippet runs fine for me.
However, you might be able to use Qt.QueuedConnection (rather than the
default Qt.DirectConnection) when calling .connect() to work around
This will cause Qt to call your slot when back in the main loop, rather
than directly - it will require having a main loop running, though.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the PySide