QPixmap::grabWidget failure
-
Hi Guys,
I'm working on to an application, and I want to used QPixmap::grabWidget function to save a pixmap of my widget. The build is well, but I have an error when I run the application:
@ASSERT failure in QGLPainter: "begin() has not been called or it failed", file painting/qglpainter.cpp, line 770@
This is a part of my code:
@ QPixmap originalPixmap0 = QPixmap();// originalPixmap = QPixmap::grabWindow(My_Widget->winId());
originalPixmap0 = QPixmap::grabWidget(My_Widget);@
If I use the grabWindows, it's work well. But I want to use grabWidget to hide my widget and still have it on my Pixmap.Does anyone can help me to found where is came from?
Thank you
Don -
Thanks for the reply.
Thereby, from what you said, I can not use grabWidget, and I have to used grabWindow. But, it is not possible to get a pixmap from an hidden Qwidget with grabWindow, is it?
What I want to do is some like:
@My_Widget->hide();
...
QPixmap originalPixmap0 = QPixmap();
originalPixmap = QPixmap::grabWindow(My_Widget->winId());@
Using that way, I want to have a Pixmap of my widget, without displayed it on the screen. I have tried this, and the saved QPixmap was a screenshoot of my desktop, not an image of my widget.