In my application I have a need to block execution until a signal arrives (wait for web request to finish). This happens in a non-gui thread.
Looking at the blocking fortune client example in Qt 5.3 docs, it appears that it uses waitForConnected() method that is specific to the QTcpSocket class, but I am using QNetworkAccessManager which has no wait methods at all.
I have also read elsewhere that to do this one might want to create a temporary QEventLoop, which will block until the events complete. This solution comes with a bunch of warnings that it should not be used in "production code" because of various latent problems that might arrise in corner cases etc.
So. What's a guy to do?
Can I somehow make this work with a QWaitCondition without introducing a second thread? What synchronization primitives exist in Qt5 that would allow me to wait for a signal to arrive in a single thread?
Thanks!