
Originally Posted by
lnxusr
Well yeah, to those who know what they're doing.. ;/
Or maybe to those that can read English 
I don't get the error the first time I used up top. Would thedownloadFinished(QNetworkReply*) slot not still be valid, or can you only use them once?
I completly don't understand wha tou mean.
I'm writing this app to learn not only QT, but C++ as well.
If you want to learn QT you have to go to Appple forums. Here you can only learn Qt.
It'll take me a while to get the hang of the OO world.
OO has nothing to do with asynchronous execution.
QT's documentation is not easy to follow if you don't know the basics of C++, but I'm still working on the app anyway.
You should really learn C++ first before taking on Qt. You'll save yourself lots of time.
By the way, if all you wanted was to save the download to a file, you might have done it in much shorter code.
http->setHost(...);
file
->open
(QFile::WriteOnly);
http->get("...", file);
QHttp *http = new QHttp(this);
http->setHost(...);
QFile *file = new QFile("...");
file->open(QFile::WriteOnly);
http->get("...", file);
To copy to clipboard, switch view to plain text mode
And that's it.
Alternatively with QNetworkAccessManager:
QNetworkReply *reply = manager->get(...);
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(saveToFile(QNetworkReply*)));
//...
void ThisClass::saveToFile(QNetworkReply *reply) {
f.open(...);
f.write(reply->readAll());
}
QNetworkReply *reply = manager->get(...);
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(saveToFile(QNetworkReply*)));
//...
void ThisClass::saveToFile(QNetworkReply *reply) {
QFile f(...);
f.open(...);
f.write(reply->readAll());
}
To copy to clipboard, switch view to plain text mode
Bookmarks