Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

Making asynchronous calls work like synchronous calls

$
0
0
Dear Qt users, I know this topic has been discussed all over the web. The usual suggestion is to use this: QEventLoop loop; loop.connect(object, SIGNAL(operationCompleted()), SLOT(quit())); object->startOperation(); loop.exec(QEventLoop::AllEvents|QEventLoop::WaitForMoreEvents); However I was wondering: what happens if the signal is emitted before we call loop.exec()? Could we stay stuck in the exec()? Particularly if the startOperation() calls processEvents? I have used this trick a few times in the past, but I’m now struggling with an asynchronous activex. I can confirm that the operationCompleted() signal is emitted. However the loop never quits. I’ve noticed that startOperation() takes a little time (500msec) and I don’t know what happens there.

Viewing all articles
Browse latest Browse all 22112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>