My task is to download a file and then process it right away. Of course it does not work with QHttp's asynchronous API.
I tried to make QHttp synchronous by calling QHttp::setSocket() and then applying the blocking approach (see Blocking Fortune Client Example), but since requests in QHttp are queued, QHttp::setHost() does not guarantee that the socket has even started connecting, so QAbstractSocket::waitForConnected() does not work.
Now my second option is to put QHttp in a QThread and then call QThread::wait() -- but I would need a good example for that, having no experience with multi-threaded programming.
Bookmarks