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.
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.
Trap the status code of 404?
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.
Hi,
Try, this
Qt Code:
connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(onLoadFinished(bool)));To copy to clipboard, switch view to plain text mode
In onLoadFinished function you can check the result (true, or false).Qt Code:
void Browser::onLoadFinished(bool success){ qDebug() << success; if (!success) webView->page()->mainFrame()->setHtml("Page not Found"); }To copy to clipboard, switch view to plain text mode
And then you can write your message.
webView->page()->mainFrame()->setHtml("Page not Found");
Bookmarks