diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/opengl/qgl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index def0470622..72c6e035d9 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -4090,11 +4090,12 @@ QImage QGLWidget::grabFrameBuffer(bool withAlpha) { makeCurrent(); QImage res; - int w = width(); - int h = height(); + qreal pixelRatio = devicePixelRatio(); + int w = pixelRatio * width(); + int h = pixelRatio * height(); if (format().rgba()) res = qt_gl_read_frame_buffer(QSize(w, h), format().alpha(), withAlpha); - + res.setDevicePixelRatio(pixelRatio); return res; } |