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

Qt high-DPI display metrics native API usage

    XMLWordPrintable

Details

    Description

      The Qt platform plugins provides QtGui with per-screen scale factors and DPI determined using native API. Which API are we using? Is there any other API we should use?

      Native (OS/WS implements scaling)

      These scale factors are returned through QWindow/QScreen::devicePixelRatio()

      OS X
      [NSView convertSizeToBacking]

      iOS
      UIView.contentScaleFactor

      Wayland
      wl_output.scale

      Qt (QtGui implements scaling)

      These scale factors are returned through QScreen::logicalDpi() and QScreen::pixelScale(). The DPI is often computed based on screen pixel size and physical size.

      X11
      screen pixel size
      physical size: xcb_randr_get_output_info_reply_t mm_width mm_height

      X11/KDE
      Should we use a KDE API?

      X11/GNOME
      Should we use a GNOME API?

      Windows
      shcoredll.getDpiForMonitor()
      Default DPI awareness setting: PROCESS_PER_MONITOR_DPI_AWARE.
      Command line option: “dpiawareness”
      DPI awareness is not set for AA_PluginApplication applications

      Android
      android.util.DisplayMetrics().density (for the primary display only)

      eglfs
      screen pixel size
      physical size:

              Q_OS_LINUX: ioctl(framebufferDevice, FBIOGET_VSCREENINFO, fb_var_screeninfo)
      	KMS: drmModeConnector::mmWidth mmHeight
              QT_QPA_EGLFS_PHYSICAL_WIDTH
              QT_QPA_EGLFS_PHYSICAL_HEIGHT
      

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            sorvig Morten Sørvig
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes