[Qt-interest] How to copy an embedded resource file to the file system?

Marcelo Magno T. Sales mmtsales at gmail.com
Tue Sep 22 01:06:14 CEST 2009


Hello,

I would like to copy a file which is embedded in the executable (as a qt 
resource) to the file system. How to achieve that?
QFile::copy() fails with error 14 (copy error).

I've tried something like:
QFile(":/path/file").copy("/path/in/filesystem/file");

or

QFile file(":/path/file");
file.copy("/path/in/filesystem/file");

But it fails with the above mentioned error (checked with 
QFile::error())

Thanks,

Marcelo



More information about the Qt-interest-old mailing list