Hello,
how to export image or take a snapshot of QSurface Widget?
I'm using QSurface example.
Kking
Edit: i have found a solution:
Printable View
Hello,
how to export image or take a snapshot of QSurface Widget?
I'm using QSurface example.
Kking
Edit: i have found a solution:
QPixmap::grabWindow() is an obsolete method which should not be used in new code. It could be removed in a future Qt release.
If your surface is an OpenGL window, then you can use QOpenGLWindow::grabFrameBuffer() to get a QImage. If it is a QML scene window, use QQuickWindow::grabWindow(). If it is a widget, use QWidget::grab() or QWidget::render().