View Full Version : Detecting finished download of HTML content for QWebView

18th December 2010, 16:24

Is there any clean way to detect when the HTML content loaded within a QWebView has finished downloading?

The loadFinished() signal doesn't seem quite what I want; to test this I compared the contents of page()->mainFrame()->toHtml() between signals of loadProgress(). On one site the HTML content had changed at progress points of 10, 26 and 27, but beyond that I guess all the progress was due to downloading externally referenced data and perhaps rendering. I'm only curious about the downloading of the HTML content internal to a page.

This assumes that loadFinished isn't emitted until loadProgress() reaches 100, of course, but I'm sure this is reasonable.


18th December 2010, 17:20
loadFinished() fires when a complete page is ready to be displayed (so when all references are downloaded as well). In your case it's probably best to set your own network access manager using QWebPage::setNetworkAccessManager(), subclass the NAM and reimplement createRequest() where you will connect to the finished() signal of QNetworkReply that gets returned by createRequest if the request is for the url you are interested in.

18th December 2010, 17:50
Oh, wonderful.

Thank you.

21st June 2011, 19:44
For internal details of frame loading: