QWebPage How to handle a failed request

I want to handle failed requests (for example, with the error code http 404 in the response), display my own page "notfound.html" in QWebView. But there is no easy way to handle responses using the QWebView / QWebPage classes.

My Qt version is 4.7.

+3
source share
1 answer

The answer is to use the overridden function qwebpage :: extension . There you can specify an error handler for three different error domains: HTTP errors, qtnetwork errors, qtwebkit layer errors.

+6
source

Source: https://habr.com/ru/post/1765757/


All Articles