IconImage: Error decoding: qrc:/Icons/rotate-left.svg: Unsupported image format
Solved
Mobile and Embedded
-
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
-
Hi,
Did you list the SVG module dependency in your cmake project ?
-
@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)