Screenshot of QGraphicsScene with QGraphicsProxyWidget
I have a QGraphicsScene with a few QGraphicsPixmapItems and the QGraphicsProxyWidget added to it. When the screenshot is taken the the QGraphicsProxyWidget doesn't show up in the screenshot.
The code for the screenshot i tried unsuccessfully are the following :-
Code:
QPixmap MainWindow
::getScreenShot(){ QPixmap screenshotPixmap
= ui
->graphicsView
->grab
();
return screenshotPixmap;
}
Code:
QPixmap MainWindow
::getScreenShot(){ QImage img
(scene
->sceneRect
().
size().
toSize(),
QImage::Format_ARGB32_Premultiplied);
//scene->render(&painter);
ui->graphicsView->render(&painter);
tempPixmap.convertFromImage(img);
return tempPixmap;
}
What other alternative methods can be used to get the screenshot with the QGraphicsProxyWidget also present in it?
Re: Screenshot of QGraphicsScene with QGraphicsProxyWidget
I would expected all three methods to work more or less the same.
So the normal graphics items show up but the proxied widgets do not?
Which kind of widgets are those?
Cheers,
_
Re: Screenshot of QGraphicsScene with QGraphicsProxyWidget
Hi,
Yes the QGraphicsPixmapItems show up but the proxy widgets (Few push buttons) don't show up in the screenshot image.