Results 1 to 3 of 3

Thread: QWebPage error handling

  1. #1
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Question QWebPage error handling

    Hi !

    I am usign QWebPage to parse an online page and to use its data in my application. It works great but I have a few questions for enhancements :

    - How could I handle 404 error page. I can't find anything to analyse the request received from the server when using a QWebPage
    - Is there a specific signal for timeout or do I just wait for loadFinished signal to be emitted with a QTime chrono ?

    - I have tested my application on a network with a proxy. Here is the code of my proxy handling :

    Qt Code:
    1. QNetworkAccessManager *manager = page->networkAccessManager();
    2. proxy->setHostName("cache");
    3. proxy->setPort(3128);
    4. proxy->setType(QNetworkProxy::HttpProxy);
    5. manager->setProxy(*proxy);
    To copy to clipboard, switch view to plain text mode 

    It works but fails randomly on loading some files, and if I use a QWebView it seems that loadfinished is never emitted. I don't know if it is specific to this proxy or if using a proxy requires a particular way of loading pages (such like a pause between each url load) but the same code without proxy manager works great on my computer, directly connected to the internet. So I wonder if it is possible to handle error and maybe response from the proxy.

    Thanks a lot

  2. #2
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QWebPage error handling

    I have an other question. I use qwebpage but don't view them. But while my program continiously downloads pages, I notice 30~50% cpu usage and it makes the rest of my interface very slow. How could I solve this ?

    Thanks

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

    Default Re: QWebPage error handling

    I have the same problem with error handling in QWebPage.
    For example, Arora browser uses QWebPage::unsupportedContent signal and appropriate slot to handle failed requests, but I cannot understand how it works: unsupportedContent throws only when QWebPage cannot handle request scheme (like file://, ftp://, etc) or if reply consists of special header Content-Disposition.

Similar Threads

  1. Suggested Error Handling
    By Max Yaffe in forum Qt Programming
    Replies: 6
    Last Post: 15th July 2014, 17:29
  2. error with QList<my_labels *> handling
    By navid in forum Newbie
    Replies: 3
    Last Post: 4th November 2009, 14:29
  3. QNetworkReply error handling
    By timmu in forum Qt Programming
    Replies: 5
    Last Post: 25th August 2009, 09:07
  4. Can QWebPage see changes in a website
    By probine in forum Qt Programming
    Replies: 3
    Last Post: 15th August 2009, 23:23
  5. QwebPage within a QGraphicsWidget
    By Osprey in forum Qt Programming
    Replies: 0
    Last Post: 16th June 2009, 17:32

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.