void GLOutput::renderPix(){
int heighthelp = this->height();
int helpwidth = this->width();
this->resizeGL(helpwidth,2000); // my window has only a height of 800
QPixmap qp
= QPixmap::grabWidget(this,
0,
0,this
->width
(),this
->height
();
qp.
save(QFileDialog::getSaveFileName(this, tr
("Save File"),
"./untitled.png",tr
("PNG File (*.png)")),
"PNG");
this->resizeGL(helpwidth,heighthelp); // resize it to the original size
}
void GLOutput::renderPix(){
int heighthelp = this->height();
int helpwidth = this->width();
this->resizeGL(helpwidth,2000); // my window has only a height of 800
QPixmap qp = QPixmap::grabWidget(this,0,0,this->width(),this->height();
qp.save(QFileDialog::getSaveFileName(this, tr("Save File"),"./untitled.png",tr("PNG File (*.png)")),"PNG");
this->resizeGL(helpwidth,heighthelp); // resize it to the original size
}
To copy to clipboard, switch view to plain text mode
Bookmarks