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

High-DPI Improvements for QIcon

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P2: Important
    • 6.0
    • None
    • GUI: High-DPI
    • None

    Description

      QIcon has basic high-DPI support, but is in need of modernization and a round of improvements for Qt 6:

      • Previous work:
        • Qt icon and image versioning support update: QTBUG-49820
      • API: Deprecate "QWindow*"-based overloads, add "qreal devicePixelRatio"-based overloads.
        Qt 6 is standardizing on "devicePixelRatio"-type high-dpi support on all platforms (instead of having it as an opt-in mode), which allows using devicePixelRatio in API.
        • pixmap(QWindow *, QSize, ...) -> pixmap(QSize, qreal dpr, ...)
      • API: remove the actualSize(QWindow *window,) overload. Not used in practice, not needed.
      • Usage: port code and API to favor QIcon over QPixmap/QImage as much as possible, so that the decision on which variant to use is pushed as far "down" in the stack as possible, where Qt knows which screen (and dpr) the the icon should be drawn to.
        • QIcon overloads for QLabel
        • Document that QPixmap::paint() should be preferred instead of pixmap() (when applicable)
        • Style work?
          • Deprecate virtual QPixmap standardPixmap()
      • API and implementation: Add support for differating between 1x, 2x, ... pixmaps: Today, QIcon assumes that a pixmap of larger size than a base pixmap can be used both when a visually larger pixmap is needed and when a more detailed pixmap is needed. Depending on the pixmap asset set, this assumption may not hold.

      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
              sorvig Morten Sørvig
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: