summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/painting/qplatformbackingstore_qpa.cpp3
-rw-r--r--src/widgets/kernel/qwidget.cpp12
-rw-r--r--src/widgets/kernel/qwidget_p.h3
3 files changed, 13 insertions, 5 deletions
diff --git a/src/gui/painting/qplatformbackingstore_qpa.cpp b/src/gui/painting/qplatformbackingstore_qpa.cpp
index ff7d91ccea..485190d301 100644
--- a/src/gui/painting/qplatformbackingstore_qpa.cpp
+++ b/src/gui/painting/qplatformbackingstore_qpa.cpp
@@ -114,9 +114,6 @@ QWindow* QPlatformBackingStore::window() const
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()
*/
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index f02a67d9ea..662c9b7403 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -2137,7 +2137,15 @@ void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int
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())
@@ -5229,6 +5237,8 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset,
else
flags |= DontSubtractOpaqueChildren;
+ flags |= DontSetCompositionMode;
+
if (target->devType() == QInternal::Printer) {
QPainter p(target);
render_helper(&p, targetOffset, paintRegion, renderFlags);
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 8107b6ca74..d3fcdce6a8 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -284,7 +284,8 @@ public:
DrawInvisible = 0x08,
DontSubtractOpaqueChildren = 0x10,
DontDrawOpaqueChildren = 0x20,
- DontDrawNativeChildren = 0x40
+ DontDrawNativeChildren = 0x40,
+ DontSetCompositionMode = 0x80
};
enum CloseMode {