Solved how to use image in qt qml
-
hi
i have a images folder in the root folder of program
when i use this code for use image in programImage {
id: bug
source: "images/bug.jpg"
}i have this error
QML Image: Cannot open: qrc:/name of pic.jpgplease guide me
-
Hi and welcome to the devnet,
try using the full path with leading file://
source: "file:///home/username/project/images/bug.jpgedit:
or:
qrc:///images/bug.jpg -
Hi,
this error usually means "The resource (qrc:/name of pic.jpg) is not specified in a .qrc file."
Probably, you need to look at Qt Resource System article.
Most likely it will help you.