I use the following code in a QWebEngineView object to capture a web page to an image:
image=new QImage(w,h, QImage::Format_ARGB32);
painter = new QPainter(image);
render(painter);
image->save(imagefilename);
Unfortunately, it only renders part of the web page that is shown on the widget to the image. How to render the whole page to the image?