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

QSystemTrayIcon geometry is incorrect in High DPI environments

    XMLWordPrintable

Details

    • Windows

    Description

      In a High DPI enviroment (monitors > 100% scaling), and with Qt::AA_EnableHighDpiScaling enabled in the application, widgets geometry should reflect the scale factor of the screen they are displayed on.

      QSystemTrayIcon widget doesn't appear to work.  The geometry reported back is always at 100%, or equal to the actual screen resolution.   If you have your scale factor set at 200%, the geometry reported back should be 1/2 the size, but it is not.

      This requires us to do a manual workaround to apply the devicePixelRatio() to the coordinates supplied from the geometry() call.

      This is easily reproduced using the Qt systray example app.  I've attached a copy that I've modified to illustrate the issue.  I'm logging the value for the geometry for the trayIcon when the setIcon() method is called.  This is invoked by running the app and clicking on the icon in the systray.   Observe the values output to the debug window.

       

      Attachments

        1. qtbug79227.zip
          45 kB
          Friedemann Kleint
        2. systray.zip
          121 kB
          Jeremy Cook

        Issue Links

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              fish4life Jeremy Cook
              Votes:
              7 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: