diff options
Diffstat (limited to 'src/gui/painting/qwindowsurface_qws.cpp')
-rw-r--r-- | src/gui/painting/qwindowsurface_qws.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/painting/qwindowsurface_qws.cpp b/src/gui/painting/qwindowsurface_qws.cpp index d3fc9de..a816ed2 100644 --- a/src/gui/painting/qwindowsurface_qws.cpp +++ b/src/gui/painting/qwindowsurface_qws.cpp @@ -80,7 +80,7 @@ static void qt_insertWindowSurface(int winId, QWSWindowSurface *surface) 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 @@ bool QWSMemorySurface::isValid() const 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); |