This function is called before painting onto the surface begins,
with the \a region in which the painting will occur.
- \note A platform providing a backing store with an alpha channel
- needs to properly initialize the region to be painted.
-
\sa endPaint(), paintDevice()
*/
if ((flags & DrawAsRoot) && !(q->autoFillBackground() && autoFillBrush.isOpaque())) {
const QBrush bg = q->palette().brush(QPalette::Window);
- fillRegion(painter, rgn, bg);
+ if (!(flags & DontSetCompositionMode)) {
+ //copy alpha straight in
+ QPainter::CompositionMode oldMode = painter->compositionMode();
+ painter->setCompositionMode(QPainter::CompositionMode_Source);
+ fillRegion(painter, rgn, bg);
+ painter->setCompositionMode(oldMode);
+ } else {
+ fillRegion(painter, rgn, bg);
+ }
}
if (q->autoFillBackground())
else
flags |= DontSubtractOpaqueChildren;
+ flags |= DontSetCompositionMode;
+
if (target->devType() == QInternal::Printer) {
QPainter p(target);
render_helper(&p, targetOffset, paintRegion, renderFlags);
DrawInvisible = 0x08,
DontSubtractOpaqueChildren = 0x10,
DontDrawOpaqueChildren = 0x20,
- DontDrawNativeChildren = 0x40
+ DontDrawNativeChildren = 0x40,
+ DontSetCompositionMode = 0x80
};
enum CloseMode {