= Event loop
An <event loop> repeatedly obtains pending <software events> and dispatches them to their <event handlers>, waiting when no work is available. This lets one thread service many intermittent activities without a separate continuously running loop for each. Qt's application <event loop> dispatches timer, network and other <software events>.<QCoreApplication in the Qt 6 documentation>[Detailed Description; The Event Loop and Event Handling; exec()]{ref}
Suppose a button starts a calculation that takes ten <seconds>. Running that calculation synchronously inside its <event handler> prevents the same <event loop> from repainting or processing further clicks during those ten <seconds>. Dividing the work into short steps or delegating it to another thread lets the <event handler> return. An <event loop> coordinates readiness and dispatch; it does not itself provide <parallel computing> for long computations.
Back to article page