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

Adapt Windows style to High DPI

    XMLWordPrintable

Details

    • 5c60e4b8f9cc88e48f5e7652eefe90e1366ae23d

    Description

      A lot of the elements of the Windows style (Windows Vista in particular) do not look very good on a High DPI display. I've tested this using Qt 5.6 (from November 10, 2015) on Windows 10. I don't have a High DPI monitor so I'm having the OS simulate a high DPI display by opening the Display control panel, selecting the "set a custom scaling level" link, setting to 200% (or 150%), clicking OK, then clicking Apply, and then logging out and back in.

      Note that I get much better results using this method than by setting the QT_SCALE_FACTOR environment variable to 2. Apparently the Windows style doesn't support scaling, so this isn't surprising.

      In my application, I am making the following call before the QApplication object is constructed:

      QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 
      

      I've attached a screen shot of the qtbase/examples/widgets/styles/styles.pro example using Windows Vista style. Note that before compiling the example, I added the call to QApplication::setAttribute(Qt::AA_EnableHighDpiScaling).

      The screen shot also shows a few other elements I noticed don't look very good but which were not used in the styles example.

      NOTE: I recommend that you download the attached screenshot and view it on Windows at full resolution. Otherwise it's hard to see how pixelated some of the images are.

      Attachments

        1. WindowsVistaStyleIssues.png
          WindowsVistaStyleIssues.png
          178 kB
        2. screenshot-2.png
          screenshot-2.png
          298 kB
        3. screenshot-1.png
          screenshot-1.png
          28 kB
        4. qtbug49374.zip
          20 kB
        5. qtbug49374_themedrawing_diag.diff
          3 kB
        6. qtbug49374_qlineedit.txt
          1 kB
        7. qtbug49374_gallery.jpg
          qtbug49374_gallery.jpg
          916 kB
        8. qtbug49374_96dpi.jpg
          qtbug49374_96dpi.jpg
          75 kB

        Issue Links

          Activity

            People

              anrocha André De La Rocha (Inactive)
              aclight Adam Light
              Votes:
              16 Vote for this issue
              Watchers:
              25 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: