Yes, you could set up your state transitions to call QWidget::grab
then save it to a file through QPixmap
.
If you need an example of how to set up your code to call QWidget::grab
take a look at this answer: How to take ScreenShot Qt/QML
It's important to replace QPixmap::grabWidget
with QWidget::grab
because QPixmap::grabWidget
is now obsolete. Once you have the QPixmap
from QWidget::grab
follow the documentation in QPixmap
to save to the format you'd like such as jpeg, png, gif.
Here are some links to the documentation to help you out.