Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. IconImage: Error decoding: qrc:/Icons/rotate-left.svg: Unsupported image format

IconImage: Error decoding: qrc:/Icons/rotate-left.svg: Unsupported image format

Scheduled Pinned Locked Moved Solved Mobile and Embedded
cmake
3 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dmitriano
    wrote on last edited by Dmitriano
    #1

    When I build my app with CMake for Android I get

    QML IconImage: Error decoding: qrc:/Icons/rotate-left.svg: Unsupported image format
    

    and the icons are not displayed in toolbar buttons.

    I did not notice this effect with QMake. What can be the difference?

    The icons are in the resource file:

    <RCC>
        <qresource prefix="/">
    		<file>Icons/rotate-left.svg</file>
    		<file>Icons/rotate-right.svg</file>
                    ...
        </qresource>
    </RCC>
    

    CMake:

    file(GLOB_RECURSE RESOURCE_FILES ${CMAKE_SOURCE_DIR}/*.qrc)
    
    qt_add_executable(${PROJECT_NAME} ${CPP_FILES} ${RESOURCE_FILES})
    
    

    QT version: 6.2.2

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you list the SVG module dependency in your cmake project ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Did you list the SVG module dependency in your cmake project ?

        D Offline
        D Offline
        Dmitriano
        wrote on last edited by
        #3

        @SGaist Yes, I forgot it. Fixed this by adding Svg:

        find_package(Qt6 COMPONENTS Core Gui Quick Qml Multimedia LinguistTools Svg REQUIRED)
        target_link_libraries(${PROJECT_NAME}
          PRIVATE Qt6::Core Qt6::Gui Qt6::Quick Qt6::Qml Qt6::Multimedia Qt6::Svg)
        
        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved