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 :-
QPixmap MainWindow
::getScreenShot(){ QPixmap screenshotPixmap
= ui
->graphicsView
->grab
();
return screenshotPixmap;
}
QPixmap MainWindow::getScreenShot(){
QPixmap screenshotPixmap = ui->graphicsView->grab();
return screenshotPixmap;
}
To copy to clipboard, switch view to plain text mode
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;
}
QPixmap MainWindow::getScreenShot(){
QImage img(scene->sceneRect().size().toSize(), QImage::Format_ARGB32_Premultiplied);
QPainter painter(&img);
//scene->render(&painter);
ui->graphicsView->render(&painter);
QPixmap tempPixmap;
tempPixmap.convertFromImage(img);
return tempPixmap;
}
To copy to clipboard, switch view to plain text mode
What other alternative methods can be used to get the screenshot with the QGraphicsProxyWidget also present in it?
Bookmarks