Results 1 to 4 of 4

Thread: [WebKit] catch "page not found" error

  1. #1
    Join Date
    May 2010
    Posts
    22
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default [WebKit] catch "page not found" error

    Hello.

    I have WebKit Widget on MainWindow. I want to print my own message in HTML in WebKit, if page is not found.

    How to do it?

    Thanks.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [WebKit] catch "page not found" error

    Trap the status code of 404?

  3. #3
    Join Date
    May 2010
    Posts
    22
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: [WebKit] catch "page not found" error

    Hi.

    not error 404

    for example in webview->load ("http://www.balblabwefweew.com") and nothing happen.

    i want to show message in HTML info: page not found check url etc.

  4. #4
    Join Date
    Oct 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [WebKit] catch "page not found" error

    Hi,

    Try, this
    Qt Code:
    1. connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(onLoadFinished(bool)));
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. void Browser::onLoadFinished(bool success){
    2. qDebug() << success;
    3. if (!success)
    4. webView->page()->mainFrame()->setHtml("Page not Found");
    5.  
    6. }
    To copy to clipboard, switch view to plain text mode 
    In onLoadFinished function you can check the result (true, or false).
    And then you can write your message.
    webView->page()->mainFrame()->setHtml("Page not Found");

Similar Threads

  1. Replies: 2
    Last Post: 20th March 2010, 19:22
  2. "Cannot run program "C:\Qt\4.3.3\bin\qmake": file not found
    By PeteH in forum Installation and Deployment
    Replies: 1
    Last Post: 7th February 2009, 01:48
  3. "Treat wchar_t as Built-in Type" to "yes" link error
    By sungaoyong in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2008, 12:45
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 16:58

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.