summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qopenglwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qopenglwidget.cpp')
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index c96b6812c4..51e78ec765 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -938,7 +938,8 @@ QImage QOpenGLWidgetPrivate::grabFramebuffer()
q->makeCurrent();
}
- QImage res = qt_gl_read_framebuffer(q->size() * q->devicePixelRatioF(), false, false);
+ const bool hasAlpha = q->format().hasAlpha();
+ QImage res = qt_gl_read_framebuffer(q->size() * q->devicePixelRatioF(), hasAlpha, hasAlpha);
res.setDevicePixelRatio(q->devicePixelRatioF());
// While we give no guarantees of what is going to be left bound, prefer the