views:

2511

answers:

2
A: 

Can you provide us the paint code ? Do you subclass a widget ?

RoccoD
+4  A: 

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

Edit: Better use CompositionMode_Clear and paint the rect with whatever color.

extropy