diff -r dee5afe5301f -r 3f74d0d4af4c src/gui/painting/qwindowsurface_qws.cpp --- 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 rects = rgn.rects(); + const QColor blank = Qt::transparent; + for (QVector::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);