Frage

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?

War es hilfreich?

Lösung

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.

 ...
 }
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top