January 16, 2012

fronald fronald
Lab Rat
23 posts

How to extract a resource from qrc (Solved)

 

Hi,

I need extract 1 file on first run of my desktop application. My resource is in a qrc.

How do it?

Thanks.

3 replies

January 16, 2012

pkj__ pkj__
Lab Rat
32 posts

QFile::copy(”:/path/to/qrc”, “path/to/copy”);
copies the file from qrc to directory you specify. You can use other methods of QFile to load the file in memory.

January 16, 2012

Lukas Geyer Lukas Geyer
Gene Splicer
2074 posts

Resources are completely transparent to the application and they might be treated as regular files, for example for copying (see previous post). The only restriction is that they are read-only, both the files itself (you cannot modify them) and the directory strucuture they are contained in (you cannot add or remove files to or from a resource collection).

January 16, 2012

fronald fronald
Lab Rat
23 posts

Qt is wonderful

My simple question have a simple answer.

Thanks!

 
  ‹‹ Colliding Mice Qt 4 example question      Hide shorcut text of QMenu Action and more ;) ››

You must log in to post a reply. Not a member yet? Register here!