ok , so i changed some things in my code in the request () function :
instead of this :
connect(reply, SIGNAL(&reply::readyRead()), this, SLOT(httpReadyRead()));
connect(reply, SIGNAL(&reply::readyRead()), this, SLOT(httpReadyRead()));
To copy to clipboard, switch view to plain text mode
i changed into this :
connect(reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead()));
connect(reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead()));
To copy to clipboard, switch view to plain text mode
and i added " QNetworkReply* " and it gives this :
connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(httpFinished()));
connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(httpFinished()));
To copy to clipboard, switch view to plain text mode
So in the end i have this code for request ():
void httpWindow
::request(QUrl url
) {
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(httpFinished()));
//requete.setUrl(QUrl("http://fxrates.fr.forexprostools.com/index.php?force_lang=5&pairs_ids=1;3;2;4;7;5;8;6;&header-text-color=%23FFFFFF&curr-name-color=%230059b0&inner-text-color=%23000000&green-text-color=%232A8215&green-background=%23B7F4C2&red-text-color=%23DC0001&red-background=%23FFE2E2&inner-border-color=%23CBCBCB&border-color=%23cbcbcb&bg1=%23F6F6F6&bg2=%23ffffff&bid=show&ask=show&last=show&change=hide&last_update=hide"));
requete.setUrl(url);
reply = manager->get(requete);
connect(reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead()));
//connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),
//SLOT(onError(QNetworkReply::NetworkError)));
}
void httpWindow::request(QUrl url)
{
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(httpFinished()));
//requete.setUrl(QUrl("http://fxrates.fr.forexprostools.com/index.php?force_lang=5&pairs_ids=1;3;2;4;7;5;8;6;&header-text-color=%23FFFFFF&curr-name-color=%230059b0&inner-text-color=%23000000&green-text-color=%232A8215&green-background=%23B7F4C2&red-text-color=%23DC0001&red-background=%23FFE2E2&inner-border-color=%23CBCBCB&border-color=%23cbcbcb&bg1=%23F6F6F6&bg2=%23ffffff&bid=show&ask=show&last=show&change=hide&last_update=hide"));
requete.setUrl(url);
reply = manager->get(requete);
connect(reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead()));
//connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),
//SLOT(onError(QNetworkReply::NetworkError)));
}
To copy to clipboard, switch view to plain text mode
This is the code for httpFinished():
if (httpRequestAborted) {
if (file) {
file->close();
file->remove();
delete file;
file = 0;
}
reply->deleteLater();
return;
}
file->flush();
file->close();
QVariant redirectionTarget
= reply
->attribute
(QNetworkRequest
::RedirectionTargetAttribute);
if (reply->error()) {
file->remove();
} else if (!redirectionTarget.isNull()) {
QUrl newUrl
= url.
resolved(redirectionTarget.
toUrl());
url = newUrl;
reply->deleteLater();
file->resize(0);
request(url);
return;
}
reply->deleteLater();
reply = 0;
delete file;
file = 0;
}
if (httpRequestAborted) {
if (file) {
file->close();
file->remove();
delete file;
file = 0;
}
reply->deleteLater();
return;
}
file->flush();
file->close();
QVariant redirectionTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if (reply->error()) {
file->remove();
} else if (!redirectionTarget.isNull()) {
QUrl newUrl = url.resolved(redirectionTarget.toUrl());
url = newUrl;
reply->deleteLater();
file->open(QIODevice::WriteOnly);
file->resize(0);
request(url);
return;
}
reply->deleteLater();
reply = 0;
delete file;
file = 0;
}
To copy to clipboard, switch view to plain text mode
When i started Debug , i got these errors :
can't find linker symbol for virtual table for `QMessageBox' value
found `RGB_MASK' instead
can't find linker symbol
for virtual table
for `
QMessageBox' value found `RGB_MASK' instead
"http://fxrates.fr.forexprostools.com/index.php?force_lang=5&pairs_ids=1;3;2;4;7;5;8;6;&header-text-color=%23FFFFFF&curr-name-color=%230059b0&inner-text-color=%23000000&green-text-color=%232A8215&green-background=%23B7F4C2&red-text-color=%23DC0001&red-background=%23FFE2E2&inner-border-color=%23CBCBCB&border-color=%23cbcbcb&bg1=%23F6F6F6&bg2=%23ffffff&bid=show&ask=show&last=show&change=hide&last_update=hide
can't find linker symbol for virtual table for `QMessageBox' value
found `RGB_MASK' instead
can't find linker symbol for virtual table for `QMessageBox' value
found `RGB_MASK' instead
"http://fxrates.fr.forexprostools.com/index.php?force_lang=5&pairs_ids=1;3;2;4;7;5;8;6;&header-text-color=%23FFFFFF&curr-name-color=%230059b0&inner-text-color=%23000000&green-text-color=%232A8215&green-background=%23B7F4C2&red-text-color=%23DC0001&red-background=%23FFE2E2&inner-border-color=%23CBCBCB&border-color=%23cbcbcb&bg1=%23F6F6F6&bg2=%23ffffff&bid=show&ask=show&last=show&change=hide&last_update=hide
To copy to clipboard, switch view to plain text mode
and the application stucked saying it can not continue so i stopped the debug .
Please help me identify these errors , i am sure you are more knowledge in these than me .
Bookmarks