2
votes

I want to log every element that is loaded by request (images, javascripts, styles, etc). I load page via QWebView. But there is only basic signals like start loading, progress, finished loading. And can't find how can I record each step of what webview is doing. Or it's impossible?

1

1 Answers

2
votes

The simplest thing you can do here is listen to QNetworkAccessManager's finished() signal.

To get the AccessManager

QNetworkAccessManager mgr = webView->page()->networkAccessManager();

in the slot that catches the finished signal

myclass::slot(QNetworkReply* reply)
{
 ...
  reply->request()->url(); //gives you the resource requested.
  //DO NOT preform any other operation on 'request', request is sequential QIODevice.

 ...
 }