diff --git a/.gitignore b/.gitignore index fab7372..36f49b4 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,6 @@ Thumbs.db *.dll *.exe +# 编译目录 +build/ +build-*/ diff --git a/MultiplethreadDownload/widget.cpp b/MultiplethreadDownload/widget.cpp index b824ae6..a7b7221 100644 --- a/MultiplethreadDownload/widget.cpp +++ b/MultiplethreadDownload/widget.cpp @@ -109,6 +109,7 @@ void Widget::singleDownload(const QString& url, const QString& filename) file.write(reply->readAll()); }); connect(reply, &QNetworkReply::finished, &event, &QEventLoop::quit); + connect(reply, &QNetworkReply::downloadProgress, this, &Widget::download_progress_change); connect(reply, &QNetworkReply::errorOccurred, [this, reply](QNetworkReply::NetworkError error){ if (error != QNetworkReply::NoError) showError(reply->errorString()); });