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. QML Image: Cannot open: qrc:/untitled3/profilna.png
Forum Updated to NodeBB v4.3 + New Features

QML Image: Cannot open: qrc:/untitled3/profilna.png

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
7 Posts 2 Posters 690 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
    Jovan Dra
    wrote on last edited by
    #1

    Hello,
    I'm dealing with this simple yet frustrating problem for a long time. I create a new Qt Quick project and set my Android Qt Clang x86_64 kit (cmake). The issue starts when I want to add an image in my application. I add the image into the projects folder and use the code Image{ source = "profilna.png" }, but when I built it, I got a warning saying : "libappuntitled3_x86_64.so: qrc:/untitled3/Main.qml:10:5: QML Image: Cannot open: qrc:/untitled3/profilna.png" in the Application Output. I'm a complete beginner in Qt Quick and don't understand why it works in Desktop MinGW kit and not on Android.

    JoeCFDJ 1 Reply Last reply
    0
    • J Jovan Dra

      Hello,
      I'm dealing with this simple yet frustrating problem for a long time. I create a new Qt Quick project and set my Android Qt Clang x86_64 kit (cmake). The issue starts when I want to add an image in my application. I add the image into the projects folder and use the code Image{ source = "profilna.png" }, but when I built it, I got a warning saying : "libappuntitled3_x86_64.so: qrc:/untitled3/Main.qml:10:5: QML Image: Cannot open: qrc:/untitled3/profilna.png" in the Application Output. I'm a complete beginner in Qt Quick and don't understand why it works in Desktop MinGW kit and not on Android.

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      @Jovan-Dra did you add the image file into a qrc file and build your app or lib with the qrc file?

      J 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        @Jovan-Dra did you add the image file into a qrc file and build your app or lib with the qrc file?

        J Offline
        J Offline
        Jovan Dra
        wrote on last edited by
        #3

        @JoeCFD Thanks for helping!
        I have. I put my image into "img" folder inside my project, then went right click on "appuntitled3" -> Add New -> Resource File -> named it resources -> Add Prefix (renamed to "/img") -> Add Files -> chose the picture and copied its address inside the .qrc (:/img/img/profilna.png) -> pasted to source. I did all the above but it comes with an error. 892a983e-9b73-47de-8661-ad2cab2ff8ac-image.png

        JoeCFDJ 1 Reply Last reply
        0
        • J Jovan Dra

          @JoeCFD Thanks for helping!
          I have. I put my image into "img" folder inside my project, then went right click on "appuntitled3" -> Add New -> Resource File -> named it resources -> Add Prefix (renamed to "/img") -> Add Files -> chose the picture and copied its address inside the .qrc (:/img/img/profilna.png) -> pasted to source. I did all the above but it comes with an error. 892a983e-9b73-47de-8661-ad2cab2ff8ac-image.png

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4

          @Jovan-Dra can you try
          qrc:/img/img/profilna.png

          J 1 Reply Last reply
          0
          • JoeCFDJ JoeCFD

            @Jovan-Dra can you try
            qrc:/img/img/profilna.png

            J Offline
            J Offline
            Jovan Dra
            wrote on last edited by
            #5

            @JoeCFD I did. It "fixes" the error, but the image doesn't want to show on screen.
            7b234e54-fafa-4404-b140-7f3bd8f0ddfe-image.png

            JoeCFDJ 1 Reply Last reply
            0
            • J Jovan Dra

              @JoeCFD I did. It "fixes" the error, but the image doesn't want to show on screen.
              7b234e54-fafa-4404-b140-7f3bd8f0ddfe-image.png

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by JoeCFD
              #6

              @Jovan-Dra show more code to let other people here help you.

              J 1 Reply Last reply
              0
              • JoeCFDJ JoeCFD

                @Jovan-Dra show more code to let other people here help you.

                J Offline
                J Offline
                Jovan Dra
                wrote on last edited by
                #7

                @JoeCFD
                main.cpp
                31264a81-4d9f-44e3-ad96-f7f51597880d-image.png
                Main.qml
                15a26874-3db3-44c3-9dee-0c65004813d5-image.png
                CMakeLists.txt
                55fb14f7-e2a0-45a0-a756-6d6c648c531e-image.png

                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