Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想处理失败的请求(例如,回复 http 404 错误代码),在 QWebView 中显示我自己的“notfound.html”页面。但是没有简单的方法来处理 QWebView/QWebPage 类的回复。
我的 Qt 版本是 4.7。
答案是使用重新实现的函数qwebpage::extension。在那里,您可以为三个不同的错误域指定错误处理程序:http 错误、qtnetwork 层错误、qtwebkit 层错误。