Can you provide us the paint code ? Do you subclass a widget ?
RoccoD
2009-01-21 15:28:38
Just use:
QPainter p
p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
p.fillRect(boundsRect, QColor(0, 0, 0, 0));
This discards the old contents and fills with transparent color.
More info at
http://techbase.kde.org/Development/Tutorials/Graphics/Performance#QPixmap::setAlphaChannel.28.29
http://doc.trolltech.com/qtjambi-4.4/html/com/trolltech/qt/gui/QPainter.CompositionMode.html
Edit: Better use CompositionMode_Clear and paint the rect with whatever color.