summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qopenglwindow.cpp
diff options
context:
space:
mode:
authorFilipe Azevedo <filipe.azevedo@kdab.com>2016-12-13 16:02:23 +0100
committerFilipe Azevedo <filipe.azevedo@kdab.com>2017-04-09 13:42:34 +0000
commit07bd5a90a3dccaa31940e3b1a78069f55e25405a (patch)
tree3a4183e199f65c4ec0377dd65b59a6970c126e7e /src/gui/kernel/qopenglwindow.cpp
parent944bf6867f8360e7ec79f542f65b4ea556ecc4e5 (diff)
Fix hidpi support for opengl window grabbing
Now set the QImage devicePixelRatio so the content is correct on all screens. Task-number: QTBUG-53795 Change-Id: Ic92eee98f691ebb1e0212498c1ae13ede74bca93 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/gui/kernel/qopenglwindow.cpp')
-rw-r--r--src/gui/kernel/qopenglwindow.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qopenglwindow.cpp b/src/gui/kernel/qopenglwindow.cpp
index e1bd3d11b2..5170c7ab63 100644
--- a/src/gui/kernel/qopenglwindow.cpp
+++ b/src/gui/kernel/qopenglwindow.cpp
@@ -528,7 +528,9 @@ QImage QOpenGLWindow::grabFramebuffer()
return QImage();
makeCurrent();
- return qt_gl_read_framebuffer(size() * devicePixelRatio(), false, false);
+ QImage img = qt_gl_read_framebuffer(size() * devicePixelRatio(), false, false);
+ img.setDevicePixelRatio(devicePixelRatio());
+ return img;
}
/*!