How to force QML Settings to write in INI format ?
-
I'm looking over the documentation of Settings http://doc.qt.io/qt-5/qml-qt-labs-settings-settings.html and QSettings http://doc.qt.io/qt-5/qsettings.html.
According to it, it's possible to force the Qsettings class to write the settings in an .ini file by passing
QSettings::IniFormat
to the constracutor. My question is how to achive the same result with the QML settings class.Also, where this ini file would be saved?
-
@Curtwagner1984 You can't, documentation is explicit about that: "The information is stored in the system registry on Windows, and in XML preferences files on macOS. On other Unix systems, in the absence of a standard, INI text files are used." QML Settings type is minimalistic, you have to do it in C++ if you want anything else.
-
@Curtwagner1984 QSettings is a private implementation detail of Settings, I think it's mentioned only to highlight why QML Settings can't do certain things.
-
For my app purposes I wrapped
QSettings
withQObject
accessible from QML code.
This in only one way I've known so far but I like it.Read here: http://doc.qt.io/qt-5/qsettings.html#platform-specific-notes for places where settings file is written