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

Qicon::addFile() behaves different with two different image

    XMLWordPrintable

Details

    • Windows

    Description

      Strangely if .png is added first and then .svg in QIcon, it works availableSizes() returns both. 
      But if .svg is added first and then .png then availableSizes() returns nothing. Though icons are displayed.

      Document does says the type of icon engine is determined by the first file to a QIcon object. Additional files will then be handled by the same engine, so here Icon engine provided by QtSvg module should add it.

      But when querying availableSizes() QPixmapIconEngine::availableSizes() does returns the data, but following function which is called in case of svg has no implementation.

      QList<QSize> QIconEngine::availableSizes(QIcon::Mode /*mode*/, QIcon::State /*state*/)
      {
          return {};
      } 

      Attached tiny example can be used to see this.

      Attachments

        1. qtbug133550.zip
          4 kB
          Irfan Omair
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vgt Eirik Aavitsland
            irfan.omair@digia.com Irfan Omair
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes