summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-05-07 13:07:34 +0200
committerLiang Qi <liang.qi@qt.io>2017-05-07 13:08:18 +0200
commitd1ea4813458b383e66ce4df69d1833b8b6a279c4 (patch)
tree3bdc16da993e5de56b669e6774fb0748075ddd90 /src/gui/kernel/qwindow.cpp
parent1c87d4e1a1d0e1972f6dc85e55ea9be8a42797ba (diff)
parent0b1ec78c2d4871afcc89d5b046926b88f0819a7c (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/network/access/qnetworkreply.cpp tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp Change-Id: Iadf766269454087e69fb216fc3857d85b0ddfaad
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 6e7be2aec2..796a552bcb 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1187,20 +1187,19 @@ Qt::ScreenOrientation QWindow::contentOrientation() const
Common values are 1.0 on normal displays and 2.0 on Apple "retina" displays.
\note For windows not backed by a platform window, meaning that create() was not
- called, the function will fall back to QGuiApplication::devicePixelRatio() which in
- turn returns the highest screen device pixel ratio found on the system.
+ called, the function will fall back to the associated QScreen's device pixel ratio.
- \sa QScreen::devicePixelRatio(), QGuiApplication::devicePixelRatio()
+ \sa QScreen::devicePixelRatio()
*/
qreal QWindow::devicePixelRatio() const
{
Q_D(const QWindow);
- // If there is no platform window use the app global devicePixelRatio,
- // which is the the highest devicePixelRatio found on the system
- // screens, and will be correct for single-display systems (a very common case).
+ // If there is no platform window use the associated screen's devicePixelRatio,
+ // which typically is the primary screen and will be correct for single-display
+ // systems (a very common case).
if (!d->platformWindow)
- return qApp->devicePixelRatio();
+ return screen()->devicePixelRatio();
return d->platformWindow->devicePixelRatio() * QHighDpiScaling::factor(this);
}