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

Qt svg icon engine does not support multiple png icons

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.9.0 FF
    • 5.5.1
    • SVG Support
    • None
    • Doesn't matter, but Windows 8 used.
    • e7331bd3b (dev)

    Description

      I create icon in such way:

      QIcon icon;
      icon.addFile( "icon.svg", QSize() );
      icon.addFile( "icon16.png", QSize( 16, 16 ) );
      icon.addFile( "icon32.png", QSize( 32, 32 ) );
      icon.addFile( "icon64.png", QSize( 64, 64 ) );

      Then I use it:
      QPixmap p = icon.pixmap( 16 );
      QPixmap p = icon.pixmap( 32 );
      QPixmap p = icon.pixmap( 64 );
      QPixmap p = icon.pixmap( 256 );

      In all cases icon engine (not sure about 64) returns svg converted to pixmap. I expect to have png in first three situations.

      The reason is probably addedPixmaps hash map in QSvgIconEngine which hashes using only icon mode and state and ignores size.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            witekt Witek Tyszkowski
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes