Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8254901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:20:54+00:00 2026-06-08T01:20:54+00:00

I am using Qt (the fancy browser example with the Qt creator) to create

  • 0

I am using Qt (the fancy browser example with the Qt creator) to create a screen shot of web pages using this code (taken and converted from here):

QImage *image = new QImage(view->page()->mainFrame()->contentsSize(), QImage::Format_ARGB32);
QPainter *painter = new QPainter(image);

view->page()->mainFrame()->render(painter);

painter->end();
image->save(view->title() + "png");

But it only creates a screen shot of the visible portion of the page (view port).

If I add this line at the beginning, the screen shot is created from the whole page, but the problem is, it adds a new scroll bar each time a page loads.

view->page()->setViewportSize(view->page()->mainFrame()->contentsSize());

Any idea how to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:20:56+00:00Added an answer on June 8, 2026 at 1:20 am

    You just need to disable the scrollbars:

    page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
    page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
    

    For a complete example, use what I have described 3.5 years ago in Capturing web pages blog post. The code repository for that has been since moved to http://qt.gitorious.org/qt-labs/graphics-dojo.

    If you pay attention to the above example, there is no need to create QWebView. You can totally work only from QWebPage instance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having an array and a mask for this array, using fancy indexing, it is
I'm using a ajax script to load content from other pages, without having to
I am creating a jquery image gallery and I am using fancy box to
I am looking for a fancy Slider control using JQuery/Javascript. The native JQuery slider
I am using xcode to develop a prototype application. Nothing too fancy, just slide
I've written some simple online games using purely HTML5 and JavaScript. Nothing fancy, no
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using CI for the first time and i'm smashing my head with this seemingly
I've been using VIM for a few weeks now while messing with various web
Using fancy box I ahve built a photgallery. When the user clicks on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.