myWallJSON
myWallJSON

Reputation: 9512

How to copy qrc resource file into filesystem?

I wonder how to copy file that is embeded into app qrc into fs? Stuff like

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

seems not to work. Why and how to make it to?

Upvotes: 8

Views: 6363

Answers (1)

Martin Beckett
Martin Beckett

Reputation: 96147

You don't need the qrc, resources start with a :

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

PS: I'm not sure how QFile treats case sensitiveness on resource filenames. For best portability you might want to make sure the case matches whatever is in your qrc file.

Upvotes: 10

Related Questions