Re: QEventLoop not closing
We have no idea what the rest of your program does after the m_loop.exec() call returns. Calling exit() on the QEventLoop has nothing to do with closing windows or applications.
Re: QEventLoop not closing
The real problem is that I don't know why exit is not executing inmediatly.
Do you know the reason?
Here some aclaration :
m_Loop = new QEventLoop() -- class parameter
--do stuff
--connect keyPressed - quit(m_loop)
m_loop.exec() --In order to wait a keyPressed and close the window
-- End the window
The problem is that exit invoked from the other slot is not executing inmediatly
Re: QEventLoop not closing
event loop works by calling processEvents after wait for new events.
processEvents works until event queue is empty.
If you have some widgets which get shown lots of things may happen after event loop is activated (loading style, processing layouts, painting, ...).
So how fast event loop returns depends on that what kind of objects you have active and what is the state of this objects.
Re: QEventLoop not closing
Then, there is any way to force eventLoop to quit inmediatly from EnergySaver slot?
Added after 1 29 minutes:
I tried to force system to invoke inmediatly the eventLoop-quit slot executing inside energySaver slot
QApplication::processEvents(QEventLoop::AllEvents)
It doesn´t works :-(