在下面的代码中:
connect(network_access_manager_, SIGNAL(finished(QNetworkReply*)),
this, SLOT(onRequestCompleted_progress(QNetworkReply *)));
network_access_manager_->get(request);
关键是,当通过get(请求)下载文件正在进行中时,我想将来自QNetworkReply的信号连接到progressBar,但我根本不知道我该怎么做呢? QNetworkReply未命名 有什么想法吗?
答案 0 :(得分:4)
network_access_manager_->get(request);
会返回QNetworkReply*
,所以
QNetworkReply *reply = network_access_manager_->get(request);
connect(reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(......))
将服务。