The QEventLoop class, part of the Qt framework, provides a means of entering and leaving an event loop.
At any time, you can create a QEventLoop
object and call exec()
on it to start a local event loop. From within the event loop, calling exit()
will force exec()
to return.
The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.