diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-11-13 01:00:13 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-11-13 01:00:13 +0100 |
commit | 0441d959ff87431ab432ce0c30bbb857a631742e (patch) | |
tree | 25c6c4293f74e39b9d4cf45b15957f233cffa9c5 /src/gui/kernel | |
parent | ae0dd3201bc13b81c62752bb04e42362c78bfe16 (diff) | |
parent | 8c685b765bf4ceba3c4cf8fdd9c9d680f338b7a9 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I5dbdc13c6133e5b03e362c5461b4a599d781bd1e
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qscreen.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index 479e228e27..f208eb02be 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -701,6 +701,11 @@ void QScreenPrivate::updatePrimaryOrientation() border of the window. If \a height is negative, the function copies everything to the bottom of the window. + The offset and size arguments are specified in device independent + pixels. The returned pixmap may be larger than the requested size + when grabbing from a high-DPI screen. Call QPixmap::devicePixelRatio() + to determine if this is the case. + The window system identifier (\c WId) can be retrieved using the QWidget::winId() function. The rationale for using a window identifier and not a QWidget, is to enable grabbing of windows @@ -748,7 +753,7 @@ QPixmap QScreen::grabWindow(WId window, int x, int y, int width, int height) QPixmap result = platformScreen->grabWindow(window, nativePos.x(), nativePos.y(), nativeSize.width(), nativeSize.height()); - result.setDevicePixelRatio(factor); + result.setDevicePixelRatio(result.devicePixelRatio() * factor); return result; } |