Hey, 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: https://doc.qt.io/qt-5/qt.html#ConnectionType-enum 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. Florian
signature.asc
Description: PGP signature
_______________________________________________ PySide mailing list PySide@qt-project.org https://lists.qt-project.org/listinfo/pyside