No one?
This is the little test code i got, to clarify a bit more:
m_httpMan = new QNetworkAccessManager(this);
void MainWindow::on_btnURL_clicked()
{
QNetworkRequest request
(QUrl(ui
->txtURL
->text
()));
m_httpReply = m_httpMan->get(request);
connect (m_httpReply, SIGNAL(readyRead()), this, SLOT(on_httpReplyReadyRead()));
connect (m_httpReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(on_downloadProgress(qint64,qint64)));
}
void MainWindow::on_httpReplyReadyRead()
{
ui->txtReply->appendPlainText("ReadyRead:");
ui->txtReply->appendPlainText(newData);
}
m_httpMan = new QNetworkAccessManager(this);
void MainWindow::on_btnURL_clicked()
{
QNetworkRequest request(QUrl(ui->txtURL->text()));
m_httpReply = m_httpMan->get(request);
connect (m_httpReply, SIGNAL(readyRead()), this, SLOT(on_httpReplyReadyRead()));
connect (m_httpReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(on_downloadProgress(qint64,qint64)));
}
void MainWindow::on_httpReplyReadyRead()
{
QByteArray newData = m_httpReply->read(2048);
ui->txtReply->appendPlainText("ReadyRead:");
ui->txtReply->appendPlainText(newData);
}
To copy to clipboard, switch view to plain text mode
It's a form with a URL input box. After clicking the btnURL button, I make the request.
I expected the readyRead signal to be triggered every time I receive some data. Instead, it waits till the whole script has finished and then triggers it with the full data.
Is there a workaround, so readyRead get's triggered with chunks of data, ie. after an end of line or something?
Thanks in advance
Bookmarks