diff options
author | Morten Johan Sørvig <[email protected]> | 2016-04-25 09:27:48 +0200 |
---|---|---|
committer | Morten Johan Sørvig <[email protected]> | 2019-08-23 03:40:14 +0200 |
commit | dd9da0441b18d1946a7b3d28e4e8819b1921de6f (patch) | |
tree | 3b5d69a225b3f9603d01a93728bc5a4bf649775e /src/gui/kernel/qscreen.cpp | |
parent | 16868bd6a247d419d7c15ae10ff2c667e6110b43 (diff) |
Compute logical DPI on a per-screen basis
The logical DPI reported to applications is the platform screen
logical DPI divided by the platform screen scale factor.
Use the screen in question when calculating the DPI instead of
the values from the main screen.
QHighDpiScaling::logicalDpi now takes a QScreen pointer.
Done-with: Friedemann Kleint <[email protected]>
Task-number: QTBUG-53022
Change-Id: I0f62b5878c37e3488e9a8cc48aef183ff822d0c4
Reviewed-by: Friedemann Kleint <[email protected]>
Diffstat (limited to 'src/gui/kernel/qscreen.cpp')
-rw-r--r-- | src/gui/kernel/qscreen.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index c79f597414d..e437678221b 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -285,7 +285,7 @@ qreal QScreen::logicalDotsPerInchX() const { Q_D(const QScreen); if (QHighDpiScaling::isActive()) - return QHighDpiScaling::logicalDpi().first; + return QHighDpiScaling::logicalDpi(this).first; return d->logicalDpi.first; } @@ -301,7 +301,7 @@ qreal QScreen::logicalDotsPerInchY() const { Q_D(const QScreen); if (QHighDpiScaling::isActive()) - return QHighDpiScaling::logicalDpi().second; + return QHighDpiScaling::logicalDpi(this).second; return d->logicalDpi.second; } @@ -320,7 +320,7 @@ qreal QScreen::logicalDotsPerInchY() const qreal QScreen::logicalDotsPerInch() const { Q_D(const QScreen); - QDpi dpi = QHighDpiScaling::isActive() ? QHighDpiScaling::logicalDpi() : d->logicalDpi; + QDpi dpi = QHighDpiScaling::isActive() ? QHighDpiScaling::logicalDpi(this) : d->logicalDpi; return (dpi.first + dpi.second) * qreal(0.5); } |