I want to use the QtQuick Image object in a simple Qt project and include the image in the project. I added an image to the resource file. I used debugging to make sure that the resource exists and is compiled into the application as "Resources / myfile.png"
However, if I declare a QtQuick image object and set the source to "Resource / myfile.png", the image will not be found. Instead, I get a message:
QML Image: Cannot open: file:
The same thing happens if I try to use the C ++ approach to access the file
source: ":/Resources/dial_bg.png"
This causes a compilation error.
myfile.png was not copied to this location. myfile.png does not appear in project files, although it has been added to the resource file.
I will be pleased with the decision, which will either copy the image to the place where the image wants to pick it up, or the way for the image to access the โcompiled inโ version.
source share