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

Resource alias name implicitly affects the selected icon engine

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.7.0
    • SVG Support
    • None
    • Windows 10, VS 2015 Update 3

    Description

      Opening this bug after QTBUG-58676 was closed, as the initial wording of the issue was confusing.

      When using a SVG file as a resource for an icon, and defining an alias for it, the name of the alias affects which icon engine is used to render the icon. More specifically, if the alias does not end with ".svg", then even if the file itself was a SVG file, the QPixmapIconEngine is used. Conversely if the alias name ends with ".svg" then the QSvgIconEngine is used, which is what the user expects and generally want to have scalable icons.

      The fact that the selection of the icon engine is based, in the absence of alias, on the extension of the file, is a good thing.

      The fact that this same selection of icon engine is also influenced by the alias name is completely unexpected and very confusing (and not documented). An alias is usually used in an application to abstract the actual icon source, so that the icon file name and format can be changed if needed without having to search&replace all references to the filename in the C++ code. So the user does not expect to have to end the aliases with ".svg" in order for the SVG icon engine to be actually used instead of the pixmap one.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            djee djee
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes