How to copy qrc resource file into filesystem?

前端 未结 1 1897
南方客
南方客 2021-01-18 00:50

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\");

see

相关标签:
1条回答
  • 2021-01-18 01:38

    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.

    0 讨论(0)
提交回复
热议问题