@Dwarrel said in Pyqt Signals connecting multiple slots:
My assumption was indeed that the emit would be independent of the execution time of a listener (connected function). Knowing that that is not the case completely explains the observed behaviour.
OIC!
The behaviour depends on the parameters to connect() and whether the signalling object and the slot object are in the same or different threads.
Assuming default --- no extra parameter to connect() ---
If they are in the same thread signal/slot is executed directly, upon emit signal call, i.e. it behaves just like a direct call to the slot(s). Slots are executed consecutively per the order they were connect()ed. Signaller code does not continue until all slots have completed. If they are in different threads signal causes slot(s) to be executed queued. When slot object thread next enters Qt event loop slot(s) get executed. Order is actually undetermined. Signaller code continues immediately after emit, it does not wait. Extra parameter to connect() can be used to alter default behaviour, see docs. You still should not try DirectConnection across threads, you could choose QueuedConnection if same thread. But non-default is unusual, unless you know what you are doing.P.S.
I just noticed you are Python. the above is still correct, but there can be extra restrictions with multiple threads to do with Python GIL. But nothing special if all same thread.