By the way... This:
while(!someFlagActive) qApp->processEvents();
while(!someFlagActive) qApp->processEvents();
To copy to clipboard, switch view to plain text mode
is equivalent to this (just designed worse :P):
//...
connect(http, SIGNAL(done(bool)), &loop, SLOT(quit())); // you can use a different signal here
loop.
exec(QEventLoop::AllEvents|QEventLoop
::WaitForMoreEvents);
doSomethingAfterDoneIsEmitted();
QHttp *http;
//...
QEventLoop loop;
connect(http, SIGNAL(done(bool)), &loop, SLOT(quit())); // you can use a different signal here
loop.exec(QEventLoop::AllEvents|QEventLoop::WaitForMoreEvents);
doSomethingAfterDoneIsEmitted();
To copy to clipboard, switch view to plain text mode
Remember that done() will be processed before the loop exits!
Bookmarks