8

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?

myWallJSON
  • 9,110
  • 22
  • 78
  • 149

1 Answers1

9

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.

x29a
  • 1,761
  • 1
  • 24
  • 43
Martin Beckett
  • 94,801
  • 28
  • 188
  • 263