This is taken directly from the documentation:
"In particular, you can pass a resource path instead of a file name to the QIcon, QImage, or QPixmap constructor:"
I created a .qrc file into which I've input some .bmp files that I wish to use in my program and then I tried loading those images via:
Qt Code:
QImage Image; if(!Image.load(":/Images/sample.bmp") {To copy to clipboard, switch view to plain text mode
Ufortunately, when I run the program, the image does not load. My folder structure is such that in the same directory as the .qrc file, I have a folder called Images in which I have my images that I'm trying to acces. If I simply use the direct system path to the image in the load function, everything works fine, but using the .qrc method, I can't seem to get the image to load.
EDIT: .pro has RESOURCES listed.
Bookmarks