Resource System Volatility
-
Is the QT creator resource system non-volatile? Can I write some data to the .txt within the resource system file on the first run, and then restart the app and retrieve it back?
-
Yes and no. There are two modes in which you can use Qt's resources. The default one generates a c++ source file with the resources serialized into plain old c++ byte arrays and that gets compiled into the executable. Obviously you can't modify that without recompiling the app.
The other mode is by using external binary resources. In this case the resources are compiled into a binary blob loaded at runtime. You can unload/modify/load that blob at runtime, without even restarting your app, but you still need that blob to be created using rcc.
The source files for the resources (.like the .txt file you mentioned) are not deployed with the app. It gets compiled into the app or the external binary blob. If you want to just access modifiable files then you don't need a resource system at all. Just use the
QFile
api for them. -
Is this the binary resource method you mentioned? Or do I need extra modifications to make it into one?
-
The image upload doesn't work on the forum. We can't see the picture. Please upload it to some external service and link here.
-
@Chris-Kawa
Sorry, here you go -
@Denis-Dolzhenko said in Resource System Volatility:
Is this the binary resource method you mentioned?
No, that's the first method - the files get compiled into the executable. See the link I posted on how to create a binary resource file (basicaly you run
rcc -binary yourfile.qrc
). -
@Chris-Kawa
Okay, I'll look into that, thanks a lot!