Dainius
Dainius

Reputation: 1862

QWebView elements load progress

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?

Upvotes: 2

Views: 1358

Answers (1)

Abhijith
Abhijith

Reputation: 2642

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.

 ...
 }

Upvotes: 2

Related Questions