I am trying to read the response data from QWebView using the QNetworkAccessManager.
I followed the instrunction in the reply found here: how to get response in QtWebKit
I subclassed the QNetworkAccessManager, then set the QWebView to use the my class:
ui->explorer->page()->setNetworkAccessManager(new myNetworkAccessManager());
Then I override the createRequest function and try to read the data:
#include "mynetworkaccessmanager.h"
myNetworkAccessManager::myNetworkAccessManager(QObject *parent) :
QNetworkAccessManager(parent)
{
}
QNetworkReply *myNetworkAccessManager::createRequest ( Operation op, const QNetworkRequest & req, QIODevice * outgoingData){
QNetworkReply *reply = QNetworkAccessManager::createRequest(op, req, outgoingData);
qDebug() << reply->readAll();
return reply;
}
I still get empty data. What am i doing wrong ?