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. [solved] Qt 5.2.0 on iOS (image file in Qt's resource system not found on iOS)

[solved] Qt 5.2.0 on iOS (image file in Qt's resource system not found on iOS)

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 3.0k 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.
  • J Offline
    J Offline
    jraichouni
    wrote on last edited by
    #1

    Hi!

    I have a QML app which works fine on the Desktop.

    All .qml files and images are packaged into the qrc resource system.

    When I run the app in iOS Simulator, the images can not be loaded.
    Xcode Output gives:
    @
    qrc:///qml/BottomStatusBar/BottomStatusBar.qml:32:13: QML Image: Invalid image data: qrc:///qml/BottomStatusBar/aircraft.svg
    @

    The image item is used in the file BottomStatusBar.qml via:
    @
    Image {
    id: connectionStateImage
    anchors.centerIn: parent
    source: "aircraft.svg"
    }
    @

    The resource file contains:
    @
    <RCC>
    <qresource prefix="/">
    <file>qml/BottomStatusBar/aircraft.svg</file>
    <file>qml/BottomStatusBar/BottomStatusBar.qml</file>
    </qresource>
    </RCC>
    @

    Seems as if a lot of Qt's functionality is not completely implemented in Qt for iOS!?

    I assume that as I can not use FontLoader on iOS or work with QtSql on iOS...

    May be anyone knows a solution for the image in qrc problem described above!?

    Cheers
    jraichouni

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ahmad88me
      wrote on last edited by
      #2

      I suggest you to test on a physical device, I faced some issues with the simulator as well

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jraichouni
        wrote on last edited by
        #3

        Analysed the problem. It is not the use of qrc or iOS simulator.
        It is the referencing of svg images from within a .qml file when running on iOS simulator. That seems not to work no matter if one uses qrc:// or file:// as reference.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jraichouni
          wrote on last edited by
          #4

          One needs to add
          @
          QTPLUGIN += qsvg
          @

          to the .pro file, if one wants to use .svg images as Image source in QML.

          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