Take a snapshot of qgraphicsview

I am using Qt 4.5 and qgraphicsscene / view to show the video to the user. I would like to provide a “take a snapshot” button, and I'm sure there is a pretty simple way, much simpler of everything I think about. How can I make it elegant?

By the way, the code is here: http://gitorious.org/handy

+3
source share
2 answers

You can use the method QWidget::grab(). This method maps the given widget to pixmap and returns this pixmap. Then you can do whatever you like, for example, save to a file with QPixmap::save().

+10
source

Source: https://habr.com/ru/post/1736180/


All Articles