I have the following code:
QNetworkReply *reply = nam.get(request);
connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
info = QSharedPointer<UpdateInformation>(new UpdateInformation(reply));
This code works fine when executed from Qt Creator, even when another application that runs in the IDE invokes this one (via QProcess).
However, when ran outside the IDE, the
QNetworkReply is empty (its
length() is 0). I'm assuming this is caused by a misplaced/wrong version dependency. I copied the needed DLLs from *c:\QtSDK\Desktop\Qt\4.7.4\mingw\bin* and the application runs just fine. How can I find out which DLLs the IDE actually uses to run it? If that's not the problem, how can I gain more information?
Edit: after restructuring the code to connect to QNetworkAccessManager's
finished() signal, I found that the
QNetworkReply::UnknownNetworkError. I still have no clue about the cause though.
Solution (it won't let me answer it and there no way I'll wait 6 hours from now):
Ok, so I managed to solve it. The clue was reply->errorString() which said "Error creating SSL context ()". That quickly led me to remember that the URL was actually a HTTPS url. After a little digging around I found that in order to use the SSL functionality in Qt (and so HTTPS), one needs to copy the following openssl DLLs to the application folder: libeay32.dll and ssleay32.dll. And that's it.