Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Screen.logicalPixelDensity should be undeprecated

$
0
0
I noticed that Screen.logicalPixelDensity was recently deprecated, and I think this is very dangerous for two reasons: 1. Applications that use pixelDensity instead of logicalPixelDensity do not behave consistently with other Windows applications. Windows High DPI guidelines use logicalPixelDensity and not actual pixelDensity (which may not even be available/correct on all monitors). 2. Even Qt itself uses logicalPixelDensity in most places. For example Text.pointSize uses logicalPixelDensity. To verify this, define: function pt1(val) { return Math.floor(val * 25.4 * Screen.logicalPixelDensity / 72) } function pt2(val) { return Math.floor(val * 25.4 * Screen.pixelDensity / 72) } Now compare pointSize: 24, pixelSize: pt1(24) and pixelSize: pt2(24). The first two are equal, the last is different. Does anyone agree/disagree? Should this be a bug report? I do not deny that there are situations in which actual pixelDensity makes more sense, for example for the minimum size of a touch button for which it makes sense to use an actual measurement in mm.

Viewing all articles
Browse latest Browse all 4972

Trending Articles