Skip to content

Commit

Permalink
Use devicePixelRatio for DPI aware units
Browse files Browse the repository at this point in the history
Qt now provides good support for HiDPI.
  • Loading branch information
plfiorini committed Jun 17, 2016
1 parent 42c2f64 commit 3646145
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ui/Units.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 3646145

Please sign in to comment.