Reputation: 31
I'm doing a very small and simple implementation of a protocol where my program will send a specific URL to a target machine and the target will reply with a JSON file.
I have read many examples of how to do this in QT but still I face a log message that I don't understand and I haven't been able to figure out what the problem actually is.
This is parts of my minimalistic code that sends the http request:
The main class:
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void on_connectToSiteButton_clicked();
void httpFinished();
void httpReadyRead();
signals:
private:
Ui::MainWindow *ui;
QByteArray *mByteArray;
QNetworkAccessManager *mNetMan;
QNetworkReply *reply;
};
This is the implementation of the actual sending of the network request:
void MainWindow::on_connectToSiteButton_clicked()
{
mNetMan = new QNetworkAccessManager;
// Send a Alarm status request
const QUrl ALARMLIST_URL("http://192.168.1.115/JSON.HTML?FN=ALSummary");
reply = mNetMan->get(QNetworkRequest(ALARMLIST_URL));
connect(reply, &QNetworkReply::finished, this, &MainWindow::httpFinished);
connect(reply, &QIODevice::readyRead, this, &MainWindow::httpReadyRead);
}
When I run the code and press the button I get following message in the Application output window: QNetworkReplyHttpImplPrivate::_q_startOperation was called more than once QUrl("http://192.168.1.115/JSON.HTML?FN=ALSummary")
When I search for a solution I find only git comments but no explanation to the cause of this.
Upvotes: 3
Views: 2712
Reputation: 11
This seems to be a (meanwhile) known bug, which will be fixed in Qt 5.12.2: QTBUG-72463
Upvotes: 1