Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Screen.logicalPixelDensity should be undeprecated

Screen.logicalPixelDensity should be undeprecated

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    l0calh05t
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved