When a signal is emitted, will all of the slots attached to it be executed before the emit returns? Or are the slots just scheduled to be executed whenever convenient?

Connections can be direct or queued. For direct connections, which is the default
when connecting objects in the same thread, all of the slots will be executed before the emit returns. Slots connected to signals through a queued connection will be executed when control returns to the event loop.

The order of execution of the slots is undefined.

2 comments

September 9, 2010

Picture of danilocesar danilocesar

Ant Farmer

October 22, 2011

Picture of p-himik p-himik

Robot Herder

If a signal is connected to several slots, the slots are activated in the same order as the order the connection was made, when the signal is emitted.

Write a comment

Sorry, you must be logged in to post a comment.