QML Image: Cannot open: qrc:/untitled3/profilna.png
-
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. -
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.@Jovan-Dra did you add the image file into a qrc file and build your app or lib with the qrc file?
-
@Jovan-Dra did you add the image file into a qrc file and build your app or lib with the qrc file?
@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. -
@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.@Jovan-Dra can you try
qrc:/img/img/profilna.png -
@Jovan-Dra can you try
qrc:/img/img/profilna.png -
@Jovan-Dra show more code to let other people here help you.
-
@Jovan-Dra show more code to let other people here help you.