开发者

Get http status in Qt WebKit

What I would like to implement is

1 Us开发者_StackOverflowing Qt's WebView(part of QtWebKit) to access some page.

2 Show specified html page if got HTTP 4xx, 5xx status

(Ex> HTTP 404, 500).

3 Also shows specified page when network connection is unavailable.

For now, I had only done job 1... In job 2, how did I get http status from WebView ? In job 3, I'm looking about QUrl APIs now.

Anyone have idea or expreience yet ?


You should reimplement QWebPage::extension() with extension type of QWebPage::ErrorPageExtension.

For details see: http://doc.qt.io/qt-5/qwebpage.html#extension, http://doc.qt.io/qt-5/qwebpage-errorpageextensionoption.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜