c++imageqtqwebview

QWebview: Turn off loading images at QWebview qt


Is there any way to prevent the loading of images with the QWebview in qt?

I load with the QWebview a page with a lot of pictures, so it takes a long time until the page has fully loaded. But I only need the text below the pictures, but I have to wait until the pictures have loaded. Is there any way to prevent loading the images?


Solution

  • QWebSettings has an attribute for autoloading images. it's enabled by default so you will have to disable it.

    poWebView->page()->settings()->setAttribute(
                        QWebSettings::AutoLoadImages,false);