Answer the question
In order to leave comments, you need to log in
Incorrect work of one of the examples in the Qt distribution. Explain why?
I'm parsing the downloadmanager
example from the standard Qt distribution (examples\network\downloadmanager). The example demonstrates how using the QNetworkRequest , QNetworkReply , QNetworkAccessManager classes, you can successfully sequentially download pages from the Internet using a list of urls. Everything in it is clear and everything seems to be correct. But I noticed that contact (vk) pages are not downloaded, i.e. the file is created empty.
QNetworkRequest request(url);
currentDownload = manager.get(request);
connect(currentDownload, SIGNAL(downloadProgress(qint64,qint64)), SLOT(downloadProgress(qint64,qint64)));
connect(currentDownload, SIGNAL(finished()), SLOT(downloadFinished()));
connect(currentDownload, SIGNAL(readyRead()), SLOT(downloadReadyRead()));
void DownloadManager::downloadReadyRead()
{
output.write(currentDownload->readAll());
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question