Unsolved QNetworkAccessManager issue
-
Hi, while trying to get the hang of QNAM I've encountered what seems to be an issue. I'm running this code under Windows 10 with MinGW.
#include <QCoreApplication> #include <QNetworkAccessManager> #include <QNetworkReply> #include <QString> void test(QNetworkReply *reply) { qDebug() << reply->readAll(); reply->deleteLater(); } int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QNetworkAccessManager manager(a.instance()); QString url("http://www.example.com/"); auto reply = manager.get(QNetworkRequest(url)); QObject::connect(reply, &QNetworkReply::finished, [=](){ test(reply); }); return a.exec(); }
This seems to work fine, but aside from the expected output I also get this in the console:
QNetworkReplyHttpImplPrivate::_q_startOperation was called more than once QUrl("http://www.example.com/")
I assume this should not happen, although I don't really see what's wrong with my code. Any ideas?
-
Hi and welcome to devnet,
What version of Qt are you using ?
What OS are you running ? -
We have the same issue here.
We call "manager.get()" only once, and it seems we run into this code twice! (hence we have the warning on console)
https://git.qt.io/consulting-usa/qtbase-xcb-rendering/commit/b05ba48281052acb2e72a4175d9173458aebdbf3Qt 5.12
Windows 10 -
Is already reported: https://bugreports.qt.io/browse/QTBUG-72463