Important: Please read the Qt Code of Conduct -

How to take a full page screenshot?

  • The following code can be used in a QWebEngineView based class to take a screenshot into an image:
    QSize size=page()->contentsSize().toSize();
    QImage image(size, QImage::Format_ARGB32);
    QPainter painter(&image);

    However, only part of the web page(that is shown on the view widget) is captured. In QtWebkit, I can use setViewPort to capture the whole page but QWebEngineView does not have this function. How can I capture the entire web page now?


Log in to reply