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

Need to duplicate SVG icons for @2x support leads to increased binary size

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.7.0
    • GUI: Look'n'Feel
    • None

    Description

      At the moment high-DPI support allows specifying @Nx versions of icons for loading into a QIcon on high-DPI monitors. This solution is convenient for automatically supporting both low and high DPI monitors, but assumes that several versions of the image are needed.

      For SVG, the same source can be reused to render multiple resolutions, so that a single SVG file can be embedded to render an appropriate QIcon both on low- and high-DPI monitors at any desired @Nx. Unfortunately at the moment this require embedding the same SVG file multiple times, e.g. with and without a @2x suffix in the alias, leading to unnecessary increase in the binary size.

      Note that there are several related but slightly different issues around SVG and scaling / high-DPI support for QIcon, including:

      • QTBUG-43632 QIconEngine has no access to the devicePixelRatio
      • QTBUG-47544 Implement better highdpi handling in QImageReader
      • QTBUG-3084 Better support for multi resolution icon files
      • QTBUG-53759 Qt svg icon engine does not support multiple png icons
      • QTBUG-2198 Designer: lack of possibility to define Multi Size Icon in Action Editor

      QTBUG-47544 seems like the most sensible way to address this issue, as it allows scaling the rendering of the QIcon according to the desired size but also DPI.

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            djee djee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes