How to copy qrc resource file to file system?

I wonder how to copy a file that is built into the qrc application in fs? Stuff like

QFile::copy("qrc:/assets/files/my.file" , "C:/my.file"); 

doesn't seem to work. Why and how to do it?

+4
source share
1 answer

You do not need qrc , resources start with :

eg QFile myFile(":/data/data.xml");

PS: I'm not sure how QFile considers case sensitivity of resource files. For better portability, you may need to make sure that the case matches everything in your qrc file.

+5
source

Source: https://habr.com/ru/post/1413991/


All Articles