Ini Files
-
@Redman
If you have embedded the file as a resource in the executable then there is no external file.Beware! Such resource files can only be opened read-only, not for update, since they are embedded, A while ago I believe someone found this did not work with
QSettings
ini files, as, for right or for wrong,QSettings
insists on opening for update, because settings can be altered. And I thought they reported this then failed on an embedded ini file. Have you verified yourQSettings
works opening such a file? -
@jsulm I have some custom made ini files which I read from with QSettings. Nothing special, just some key, value pairs with string and boolean values. The ini files are registered in qrc. Is that the key factor as to why this might get built into my application, hence no need to have those ini files present anymore in the deployment folder?
-
@Redman
If you have embedded the file as a resource in the executable then there is no external file.Beware! Such resource files can only be opened read-only, not for update, since they are embedded, A while ago I believe someone found this did not work with
QSettings
ini files, as, for right or for wrong,QSettings
insists on opening for update, because settings can be altered. And I thought they reported this then failed on an embedded ini file. Have you verified yourQSettings
works opening such a file? -
@Redman Files in recourse files are built into the executable. That also means that you can not change them at runtime. To do so you need to copy the ini files into a proper location if they are not yet present there and read/modify them there. To find proper config location use: https://doc.qt.io/qt-6/qstandardpaths.html#standardLocations with QStandardPaths::AppConfigLocation
-
You can also provide default values for your settings. In that case you don't even have to include any ini files into qrc in the first place. Provide a path where ini files can be written instead.
-