Hey. I have written a QT application, which draws a lot of elments inside it. So I have made it possible to scroll inside this window.

Now I want to output ALL elements to a bitmap file. So far I am using the following code:

Qt Code:
  1. void GLOutput::renderPix(){
  2.  
  3. int heighthelp = this->height();
  4. int helpwidth = this->width();
  5.  
  6. this->resizeGL(helpwidth,2000); // my window has only a height of 800
  7.  
  8. QPixmap qp = QPixmap::grabWidget(this,0,0,this->width(),this->height();
  9. qp.save(QFileDialog::getSaveFileName(this, tr("Save File"),"./untitled.png",tr("PNG File (*.png)")),"PNG");
  10.  
  11. this->resizeGL(helpwidth,heighthelp); // resize it to the original size
  12. }
To copy to clipboard, switch view to plain text mode 

The problem is that this code works fine for the actual context which is viewable for the user at the moment, but I need something that renders all elements inside the Widget. So my idea was simply to make the GLWidget bigger, before rendering, but this has no effect at all.
I think the problem is that all pixels which are not directly shown in the window are invalid.

Any ideas are very appreciated. I simply don't know how to define the renderArea I want to grab.

thx in advance