In qt4.8, where there is still the qhttp class, I could use http->hasPendingRequests()
to check whether there is still pending requests.
But in qt5, we are forced to use the QNetworkAccessManager class to manage the http link.
How could I achieve this checking?
Better late than never, although I could not find related docs, try something like:
QNetworkAccessManager myManager;
// Some requests here...
QList<QNetworkReply *> list =
myManager->findChildren<QNetworkReply *>();
Note that above is only tested with Qt4 and Qt5 (but might be true for coming versions),
And actually, this is how Qt itself finds them for destruction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With