defuze.me
Client
|
We use the Qt Ressource System.
It allows us to compile the external static files that the application needs into a binary. The application will use that binary.
The main advantage is, after loading the binary file, we don't have to worry about the OS specific file systems.
Look at Using resources to know how to use resources in the application.
3 kind of files are used:
The application only needs the .rcc files. It will load/unload them at runtime.
Now, you need to now if you want to create a new collection, or add your resource to a existing one.
If you add the file images/picture.png in the /images prefix, the path to access it will be:
:/images/images/picture.png <- kind of ugly
In QtCreator, you can alias the resource name, replacing 'images/picture.png' by 'picture.png'. The result path will be:
:/images/picture.png <- much better!
Finally, you need to regenerate the .rcc files from the .qrc files.
If make (or mingw32-make) is in your PATH, just run "compile_resources.(bat|sh)" from the helpers directory.
Else, you can run the 'move' or 'move_win' (on Windows) target of client/client/resources/Makefile from the client/client/resources directory.