Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. SVG not supported in iOS app built using CMake
Forum Updated to NodeBB v4.3 + New Features

SVG not supported in iOS app built using CMake

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 34 Views 2 Watching
  • 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.
  • P Offline
    P Offline
    Pawel_Kleczek
    wrote last edited by
    #1

    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 format

    even 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
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote last edited by
      #2

      Hi,

      Are you using a static build of Qt ?
      If not, did you deploy the corresponding plugin and library along your application ?

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

      1 Reply Last reply
      0

      • Login

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