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

QPaintDevice::devicePixelRatioF() does not correctly return non integer ratio

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.6
    • GUI: Painting, QPA: Windows
    • None
    • Windows 10

    Description

      Using the Windows 10 Display control panel app, I click the "set a custom scaling level" link and set my scaling to 125%, 150%, or 250%. I then click OK, Apply, log out, and log back in.

      If I run the attached application, QPaintDevice::devicePixelRatioF() always returns an integer when I would expect it to return a non-integer value (eg. 1.25, 1.5, 2.5 respectively).

      I get the same results if either of the following environment variables is set as specified:
      QT_DEVICE_PIXEL_RATIO auto
      QT_AUTO_SCREEN_SCALE_FACTOR 1

      I believe this happens because in QWindowsScreen::pixelDensity(), there is a qRound (line 287) that rounds the returned value.

      Attachments

        Issue Links

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

          Activity

            People

              sorvig Morten Sørvig
              aclight Adam Light
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes