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

QScreen::geometry() returns a mix of physical pixels and device independent pixels

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P2: Important P2: Important
    • None
    • 5.14.2
    • GUI: High-DPI
    • None
    • Linux/X11

      QScreen::geometry() should return the geometry (i. e. the position and size) of the corresponding screen as QRect. However, this QRect contains the position of the screen in physical pixels and the size in device independent pixels, which causes an annoying offset if the screen is not the screen at (0, 0).

      Specifically, I have a 1920x1080 screen at (0, 0) and a 1280x1024 screen at (1920x1080). This gives me an arrangement of two screens which are diagonally connected at the corner. The screen scale is globally 131.25%.

      When I choose a QScreen* from QGuiApplications::screens(), I get these geometries:
      QRect(0,0 1463x823)
      QRect(1920,1080 975x780)
      The first is correct, the second should be QRect(1463,823 975x780).

      One could argue that screens can have different device pixel ratio, so their absolute position can not be calculated using the own device pixel ratio. But I expect QScreen::geometry() to match the geometry of QWidget(), no matter which device pixel ratios are used.

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

            sorvig Morten Sørvig
            checkedtrashcan David Hurka
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes