Im每隔X秒建立一次連接。但是如果淨帶寬超載,定時器在QNetworkAccessManager發送完成信號和應用程序崩潰之前觸發。Qtimer在QNetworkAccessManager完成之前觸發
主窗口::構建體:
pTimer = new QTimer(this);
connect(pTimer, SIGNAL(timeout()), this, SLOT(connect()));
pTimer->start(5000);
的MainWindow ::連接()
pNetworkManager = new QNetworkAccessManager(this);
connect(pNetworkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(result(QNetworkReply*)));
pNetworkManager->get(QNetworkRequest(url));
的MainWindow ::結果(QNetworkReply *回覆)處理響應
如何檢查QNetworkAccessManager在定時器再次啓動之前完成?