diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2016-06-02 09:52:21 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2019-08-23 03:40:53 +0200 |
commit | 70a893e9bee7c1b8994a1218038a302e406d0aa3 (patch) | |
tree | 11e7aa5b4eca9178fb2e6370a36291eb07ce84cb /src/gui/kernel/qscreen.cpp | |
parent | 3e5362bfa123cfc0b56c77d5e34ad63ea6e9f89a (diff) |
Move QT_FONT_DPI to cross-platform code
This makes it possible to test the effects of setting
Qt::AA_HighDpiScaling/QT_AUTO_SCREEN_SCALE_FACTOR, with different DPI
values on all platforms.
This also makes it possible to access the actual DPI values reported
by the OS/WS via the QPlatformScreen API.
A drawback is that there is no single place to check the environment
variable; currently done in three places. This may be
further simplified later on.
Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Task-number: QTBUG-53022
Change-Id: Idd6463219d3ae58fe0ab72c17686cce2eb9dbadd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/gui/kernel/qscreen.cpp')
-rw-r--r-- | src/gui/kernel/qscreen.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index e437678221..7adf3db1b8 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -84,8 +84,11 @@ void QScreenPrivate::setPlatformScreen(QPlatformScreen *screen) platformScreen->d_func()->screen = q; orientation = platformScreen->orientation(); geometry = platformScreen->deviceIndependentGeometry(); - availableGeometry = QHighDpi::fromNative(platformScreen->availableGeometry(), QHighDpiScaling::factor(platformScreen), geometry.topLeft()); - logicalDpi = platformScreen->logicalDpi(); + availableGeometry = QHighDpi::fromNative(platformScreen->availableGeometry(), + QHighDpiScaling::factor(platformScreen), geometry.topLeft()); + + logicalDpi = QPlatformScreen::overrideDpi(platformScreen->logicalDpi()); + refreshRate = platformScreen->refreshRate(); // safeguard ourselves against buggy platform behavior... if (refreshRate < 1.0) |