diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 311f9547a1..a1f3fbe8db 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5506,8 +5506,13 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP // This widget renders into a texture which is composed later. We just need to // punch a hole in the backingstore, so the texture will be visible. QPainter p(q); - p.setCompositionMode(QPainter::CompositionMode_Source); - p.fillRect(q->rect(), Qt::transparent); + if (backingStore) { + p.setCompositionMode(QPainter::CompositionMode_Source); + p.fillRect(q->rect(), Qt::transparent); + } else { + // We are not drawing to a backingstore: fall back to QImage + p.drawImage(q->rect(), grabFramebuffer()); + } } else { //actually send the paint event QPaintEvent e(toBePainted); diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 14831efca8..6520832943 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -627,7 +627,7 @@ public: #ifndef QT_NO_OPENGL virtual GLuint textureId() const { return 0; } - + virtual QImage grabFramebuffer() const { return QImage(); } void setRenderToTexture() { renderToTexture = true; setTextureChildSeen(); } void setTextureChildSeen() {