qtpyqtqwebpage

How to tell QWebPage not to load images?


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.


Solution

  • You want to turn off the AutoLoadImages:

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

    Using the QWebSettings::AutoLoadImages attribute.