如何告诉QWebPage不加载图像?

发布于 2024-08-13 15:43:32 字数 163 浏览 3 评论 0原文

我正在使用 QWebPage 加载所需的网站页面。但 QWebPage 加载所有附加资源:图像、CSS 等。 有什么方法可以呈现这种行为并取消图像加载?

我唯一的想法是 - 编写自定义 QNetworkConnectionManager,它将返回一些虚拟图片而不是请求的图片。但这看起来有点复杂。

I'm using QWebPage to load needed site page. But QWebPage loading all additional resources: images, csses, and so on.
Is there any way to present this behavior and cancel loading of images?

Only idea that I have - to write custom QNetworkConnectionManager, which will return some dummy picture instead of requested. But this looks a bit of complicated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

离去的眼神 2024-08-20 15:43:32

您想要关闭 AutoLoadImages:

http://doc.trolltech.com/ 4.4/qwebsettings.html

使用 QWebSettings::AutoLoadImages 属性。

You want to turn off the AutoLoadImages:

http://doc.trolltech.com/4.4/qwebsettings.html

Using the QWebSettings::AutoLoadImages attribute.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文