Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. How to take a full page screenshot?
Forum Updated to NodeBB v4.3 + New Features

How to take a full page screenshot?

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 517 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yetanotherqtfan
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved