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

SVG icons doesn't work as embedded resource in Qt6

    XMLWordPrintable

Details

    • Windows

    Description

      When an SVG image is included in a .qrc file and loaded via QIcon(":/ns/filename.svg") constructor, no error is shown, but no image is displayed.

      Attached is a project that demonstrate this behavior: in the window there are 2 buttons, one is set to an icon loaded from a png file, the other with a svg. Both are embedded via the qrc file in a shared library.

      On Qt 5.15, both images are shown.

      On Qt 6.2, only the one with png is shown.

      Tested on Windows.

      On Linux, the same problem can be seen if libQt6Svg6 (or equivalent) is not installed. There is no compile-time or run-time warnings.

      Attachments

        1. test_qrc_qt6.zip
          21 kB
        2. video.zip
          24.49 MB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            uthidata Dat Ng
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes