void MainWindow::on_ParceButton_clicked()
{
ui->ParceButton->setEnabled(false);
int thr = ui->lineEdit4->text().toInt();
ifstream inp_tmp("AllTempLinks.txt");
runnedth=0;
QNetworkAccessManager *nmanager = new QNetworkAccessManager;
connect(nmanager, SIGNAL(finished(QNetworkReply*)), this, SLOT(FinishedSlot(QNetworkReply*)));
string link;
while(getline(inp_tmp,link))
{
QUrl req = QUrl(QString::fromStdString(link));
while(runnedth >= thr)
{
QApplication::processEvents();
}
QNetworkReply* reply = nmanager->get(QNetworkRequest(req));
ui->label_6->setNum(totalglinks);
}
inp_tmp.close();
ui->ParceButton->setEnabled(true);
}
所有请求都已成功结束,但是ui-> label_6-> setNum(totalglinks);不工作当我的函数调用时,ParceButton仍然有效。