Results 1 to 4 of 4

Thread: Detecting finished download of HTML content for QWebView

  1. #1
    Join Date
    Sep 2010
    Posts
    14
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Detecting finished download of HTML content for QWebView

    Hello,

    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.

    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Detecting finished download of HTML content for QWebView

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2010
    Posts
    14
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Detecting finished download of HTML content for QWebView

    Oh, wonderful.

    Thank you.

  4. #4

    Default Re: Detecting finished download of HTML content for QWebView

    For internal details of frame loading:
    http://old.nabble.com/FrameLoaderCli...d16025970.html

Similar Threads

  1. Append content to QWebView
    By thrall in forum Qt Programming
    Replies: 6
    Last Post: 19th August 2013, 18:32
  2. Replies: 0
    Last Post: 3rd December 2010, 16:10
  3. Fitting QWebView to content
    By Sölve in forum Newbie
    Replies: 0
    Last Post: 7th September 2010, 01:25
  4. How to get text field content in QWebView
    By richardander in forum Qt Programming
    Replies: 1
    Last Post: 2nd June 2009, 08:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.