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

Provide a convenience function for obtaining a screen's physical pixel resolution

XMLWordPrintable

      QScreen::geometry() and QScreen::size() return a scaled screen size, as documented at https://doc.qt.io/qt-6/highdpi.html#device-independent-screen-geometry

      You can get the unscaled resolution by multiplying the reported size by the device pixel ratio:

      auto scr = app.primaryScreen();
      qDebug() << scr->size() * scr->devicePixelRatio();
      

       

      Suggestion

      Provide a convenience function to return the unscaled resolution (QScreen::unscaledSize() ?)

        For Gerrit Dashboard: QTBUG-109666
        # Subject Branch Project Status CR V

            sorvig Morten Sørvig
            skoh-qt Sze Howe Koh
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change