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

High-DPI Improvements for QIcon

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: GUI: High-DPI
    • Labels:
      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

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

          Activity

            People

            Assignee:
            sorvig Morten Sørvig
            Reporter:
            sorvig Morten Sørvig
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews