Hey everybody, thanks for your help. I've been struggling for days with this and I'm losing my patience. I have written a program in Linux (Ubuntu 8.1), WOOHOO, and now trying to deploy it in Windows (BOOOOOOO) is giving me an error with my QNetworkRequest.
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QSslSocket>
void MainWindow
::downloadLatestMaster(QString process
) {
myrUrl="http://my.hosted.server/pagetoload.php";
// file init
if(!file.
open(QIODevice::ReadWrite|QIODevice
::Text)) { ui
->textEdit
->append
(QString("!! - Failed to open "+file.
fileName()));
// further error handling
} else {
// request init
QNetworkRequest request(myUrl);
reply=manager.get(request); // perform get request
// connections connect(reply,SIGNAL(downloadProgress(qint64,qint64)),SLOT(mySetValue(qint64,qint64)));
connect(reply,SIGNAL(readyRead()),SLOT(downloadReadyRead())); // reply ready - output file
connect(reply,SIGNAL(finished()),SLOT(replyFinished())); // reply finished - close file
}
}
// output file contents
void MainWindow::downloadReadyRead()
{
file.write(reply->readAll());
}
// close file and update ui
void MainWindow::replyFinished()
{
file.close();
}
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QSslSocket>
void MainWindow::downloadLatestMaster(QString process)
{
myrUrl="http://my.hosted.server/pagetoload.php";
// file init
if(!file.open(QIODevice::ReadWrite|QIODevice::Text)) {
ui->textEdit->append(QString("!! - Failed to open "+file.fileName()));
// further error handling
} else {
// request init
QNetworkRequest request(myUrl);
reply=manager.get(request); // perform get request
// connections connect(reply,SIGNAL(downloadProgress(qint64,qint64)),SLOT(mySetValue(qint64,qint64)));
connect(reply,SIGNAL(readyRead()),SLOT(downloadReadyRead())); // reply ready - output file
connect(reply,SIGNAL(finished()),SLOT(replyFinished())); // reply finished - close file
}
}
// output file contents
void MainWindow::downloadReadyRead()
{
file.write(reply->readAll());
}
// close file and update ui
void MainWindow::replyFinished()
{
file.close();
}
To copy to clipboard, switch view to plain text mode
Instead of the normal operation I experience in Linux (WOOHOO) I see the fillowing in my output window:
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot call unresolved function OPENSSL_add_all_algorithms_noconf
Before I added the #include <QSslSocket> my proress bar didn't work and the request seemed to just be skipped over. Now that I added the include my progress bar updates, but no file is written and the data in my reply is just empty.
I am confused because I never access an SSL socket, though I can conceive that perhaps the QNetworkAccessManager does. Is this because of some shared vs. linked building problem? Am I just crazy? If anyone has come across this issue before and could possibly shed some light on my error I would so greatly appreciate it. Thank you.
Oh, by the way, I did try substituting the QNetwrokReply for an QHttp request and same error. Please help!
Bookmarks