Results 1 to 15 of 15

Thread: How to run JavaScript with the contencs of a QNetworkReply

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #12
    Join Date
    Jan 2013
    Posts
    23
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanks
    3

    Question Re: How to run JavaScript with the contencs of a QNetworkReply

    Ok in the Documentation it says that I can use the classes with out the QWebView. (since I don't need to display the entire page.)
    But I can't find ::setURL() or ::load(QUrl) on QWebPage or QWebFrame can't get it to work.
    So when you say start with QWebFrame::findFirstElement(). Am guessing this is after I have loaded the page URL.

    Since from what I managed to understand is that QWebPage is the entire page and the QWebFrame is the content on that page while QWebElement is used to search the content?

    EDIT: I found this. http://www.qtcentre.org/threads/5383...parent-classes
    Qt Code:
    1. void MainWindow::replyFinished(QNetworkReply *reply)
    2. {
    3. QWebPage page;
    4. QWebFrame *frame = page.mainFrame();
    5.  
    6. QByteArray html = reply->peek(reply->size()); //~10kB
    7. frame->setContent(html);
    8. QWebElement htmlElement = frame->documentElement();
    9. ...
    To copy to clipboard, switch view to plain text mode 
    I Think i know what to do now.
    Last edited by WetCode; 11th October 2013 at 10:34.

Similar Threads

  1. QnetworkReply Problems
    By sai_3289 in forum Qt Programming
    Replies: 6
    Last Post: 25th January 2013, 07:46
  2. QNetworkReply: how to know when data is sent?
    By mentalmushroom in forum Qt Programming
    Replies: 17
    Last Post: 24th June 2011, 09:22
  3. Subclassing QNetworkReply
    By piotr.dobrogost in forum Qt Programming
    Replies: 6
    Last Post: 19th December 2010, 09:42
  4. Replies: 9
    Last Post: 29th November 2010, 13:12
  5. When to delete QNetworkReply?
    By QPlace in forum Qt Programming
    Replies: 5
    Last Post: 11th February 2009, 13:46

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
  •  
Qt is a trademark of The Qt Company.