Screen.logicalPixelDensity should be undeprecated



  • 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.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You're on the wrong channel here to discuss this mater, this forum is more user oriented. To reach Qt's developers/maintainers you should rather ask this on the interest mailing list. Don't forget to subscribe first.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.