SVG not supported in iOS app built using CMake
-
I try to build a Qt app for iOS using CMake. The app displays some buttons with SVG pictograms (using QML's Image within Item).
Everything works fine on Android and Windows, but on iOS I get the following error(s):
QML Image: Error decoding: qrc://<filepath>.svg: Unsupported image formateven though I did place the following in my CMakeLists.txt:
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui Svg Xml Widgets) target_link_libraries(${PROJECT_NAME} PUBLIC Qt::Core Qt::Gui Qt::Svg Qt::Widgets Qt::Xml )
and placed both
#include <QtSvg>
in C++ code and
qt5_import_plugins(${PROJECT_NAME} INCLUDE Qt5::QSvgPlugin)
in CMakeLists.txt code (as some people claimed it should enforce linking Qt's SVG plugin).
Any ideas what I should configure extra for iOS for SVG icons to work?
My environment:
- Qt 5.15.2
- iOS device (physical): iPad 10
-
Hi,
Are you using a static build of Qt ?
If not, did you deploy the corresponding plugin and library along your application ?