PDA

View Full Version : QT event loop



theprobe
26th January 2011, 13:04
Hi,
I am trying to understand how the event processing occurs in QT. So, when you start up your application you have one thread right? And then you run the QApplication.exec() and it enters the event handling loop. My question is where the events come from. Presumably the OS sends them but is there another thread listening for these event to put them into the event queue?
Thanks,

squidge
26th January 2011, 13:21
They come from the OS or your code.

No, there isn't another thread listening for events from the OS, as the OS expects each application to have an event loop also and works by sending the application "messages" which the application must check for and process.

Even if you didn't use Qt, you would still have to have an event loop.