Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103957

[Reg 5.15 -> 6.3] QScreen::physicalSize() and QScreen::physicalDotsPerInch() give wrong results

    XMLWordPrintable

Details

    • Linux/X11
    • 27efadec22 (qt/qtbase/dev) 27efadec22 (qt/tqtc-qtbase/dev) b5422d2ad6 (qt/qtbase/6.3) b5422d2ad6 (qt/tqtc-qtbase/6.3)

    Description

      qDebug() << qApp->primaryScreen()->physicalSize()
               << qApp->primaryScreen()->physicalDotsPerInchY();
      
      • Qt 5: QSizeF(340, 190) 144.379
      • Qt 6: QSizeF(508, 285) 96.2526

       

      It appears that Qt 5 follows xrandr while Qt 6 follows xdpyinfo?

       

      xrandr

      eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
      

       

      xdpyinfo

      dimensions: 1920x1080 pixels (508x285 millimeters)
      resolution: 96x96 dots per inch
      

       

      Unfortunately, xdpyinfo seems to always assume DPI=96:

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              liaqi Liang Qi
              skoh-qt Sze Howe Koh
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes