From 36461454d190143ece2fc947469de63293602d47 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Sat, 18 Jun 2016 00:21:41 +0200 Subject: [PATCH] Use devicePixelRatio for DPI aware units Qt now provides good support for HiDPI. --- ui/Units.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/Units.qml b/ui/Units.qml index a20031d..dbcbe98 100644 --- a/ui/Units.qml +++ b/ui/Units.qml @@ -89,6 +89,7 @@ Item { function dp(x) { // FIXME: This won't work because Units is a singleton and is bound to the first // screen that is available during its creation + return x * Screen.devicePixelRatio; return x * (((Screen.pixelDensity * 25.4) / (Screen.logicalPixelDensity * 25.4)) / Screen.devicePixelRatio); }