Planned maintenance has been done but it did not solve the problem. So work will continue on this and a new time for trying updates will be announced asap.

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);
    render(&painter);

    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?

    Thanks!


Log in to reply