I have compiled Qt Statically and I have used it to compile my application. My exe runs anywhere but it only shows something if there is a qml/Raker/images folder in the same directory as my exe but I want the image to be included in my exe. In qml I access the image through “images/layer_0.png”(This is only one out of 20). I have read something about a resource file but I can’t completely understand it. I’m sure how to do this If any of you could just help. I also want to know if Qt Creator has some built in way of doing this.
Share
Yes, this can be done and it is built into Qt. The steps are as follows:
Alternatively to quickly “convert” all relative image paths to be accessed as resources, use the QResources scheme to set your view source in qml:
view.setSource(QUrl("qrc:/main.qml"));For more information have a look at: