Check if all children of QNetworkAccessManager is running
Solved
General and Desktop
-
-
How to check if all
QNetworkReply
of aQNetworkAccessManager
is running?I tried like this but I get a bunch of errors:
auto children = manager.findChildren<QNetworkReply *>(); std::all_of(children.begin(), children.end(), [](auto child) { });
@Mr-Gisa Going to assume (since I'm not sure) that QNetworkReply * are parented to the QNetworkAccessManager. In which case findChildren will work ... if that assumption is correct here is how you would do it:
foreach (QNetworkReply *reply, manager.findChildren<QNetworkReply *>()) { if (reply->isRunning()) { // this request is still running, do whatever you want here } }