src/gui/painting/qwindowsurface_qws.cpp
branchRCL_3
changeset 8 3f74d0d4af4c
parent 4 3b1da2848fc7
child 37 758a864f9613
--- a/src/gui/painting/qwindowsurface_qws.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/src/gui/painting/qwindowsurface_qws.cpp	Thu Apr 08 14:19:33 2010 +0300
@@ -80,7 +80,7 @@
 
 inline bool isWidgetOpaque(const QWidget *w)
 {
-    return w->d_func()->isOpaque;
+    return w->d_func()->isOpaque && !w->testAttribute(Qt::WA_TranslucentBackground);
 }
 
 static inline QScreen *getScreen(const QWidget *w)
@@ -873,6 +873,21 @@
     return true;
 }
 
+// ### copied from qwindowsurface_raster.cpp -- should be cross-platform
+void QWSMemorySurface::beginPaint(const QRegion &rgn)
+{
+    if (!isWidgetOpaque(window())) {
+        QPainter p(&img);
+        p.setCompositionMode(QPainter::CompositionMode_Source);
+        const QVector<QRect> rects = rgn.rects();
+        const QColor blank = Qt::transparent;
+        for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) {
+            p.fillRect(*it, blank);
+        }
+    }
+    QWSWindowSurface::beginPaint(rgn);
+}
+
 // from qwindowsurface.cpp
 extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset);