PDA

View Full Version : QNetorkAccessManager synchronus download



s410i
2nd August 2009, 15:21
My task is to download a file and then process it right away. Of course it does not work with QNetworkAccessManger asynchronous API. Is it possible to make it synchronous? I'm thinking of using QThread to do this. But is there any other easier option?

franz
2nd August 2009, 16:09
As far as I know you can just wait for the download to finish without having to create a separate thread. You connect to the finished() signal and then process the data you received.

Just take a good look at the example given in the detailed description (http://doc.trolltech.com/latest/qnetworkaccessmanager.html#details) of the QNetworkAccessManager doc.

wysota
3rd August 2009, 08:33
You can use the approach mentioned in this article: Keeping the GUI Responsive