PDA

View Full Version : Confusion about events posted from slots



elizabeth.h1
29th September 2009, 10:53
Hello

If I have the following code


void someslotFunc()
{
qApp->postEvent(QEvent::SomeEventType);
}


When the posted event will be processed ? When control gets to the main loop, right? Or it will be processed inside the slot?
Think that the case is when control gets to the main loop, but I am not sure
Thanks

yogeshgokul
29th September 2009, 11:05
When the posted event will be processed ? When control gets to the main loop, right?
Right !
When control returns to the main event loop.
You can also use QApplication::sendEvent(&event) if you want to send event without queue.