Hi,
I am writing an application which requires me to download certain images from certain servers.
As this happens very frequently, the usage of signal and slots will make the gui get highcup.

So the question is:

How can I make download in snyc within a thread, without an exec() loop (or even with if there is no other way) like this (which does not work though):

Qt Code:
  1. QNetworkAccessManager net;
  2. QNetworkReply *re (net.get( QNetworkRequest( QUrl( Qstring("www.blah.org/key") ) ) ));
  3. if (re->waitForReadyRead(-1)) //! @bug this does not work as supposed, waitForRead returns false and returns INSTANTLY!!
  4. qDebug() << "ReadyRead yeha!!!";
  5. if (re->error()) {
  6. qDebug() << "Can't download" << re->url().toString()
  7. << ":" << re->errorString();
  8. } else {
  9. img->load(re->readAll());
  10. qDebug() << "Savin IMG";
  11. }
  12. delete re;
To copy to clipboard, switch view to plain text mode 

Thx for any reply.