[Qt-interest] How can I grab a widget and make the pixmap's background transparency?

Kermit Mei kermit.mei at gmail.com
Wed Jul 22 10:26:04 CEST 2009


Hello, I want to use QPixmap::grabWidget(...) to get the pictures of a
widget. Then , I need draw the pixmap on another widget to product an
animation effect.

The problem is: all the widget is show on MainWindow, and MainWindo has
a background. When I draw the widget-pixmap, the pixmap has a default
background of QWidget, and it hides the MainWindow's background.

Then only way to solve it is that make the pixmap's background be
transparency, then it can show the MainWindow when drawing.

Can anyone tell me how to do it?

Thanks.

Kermit




More information about the Qt-interest-old mailing list