[SailfishDevel] How to handle app settings?
Artem Marchenko
artem.marchenko at gmail.com
Sat Dec 28 18:06:18 UTC 2013
Hi there
I believe somebody was posting to IRC a link to a QML wrapper for QSettings
done as a part of some nemo project.
If you want something QML that works, I use this pure QML LocalStorage
approach for the last couple of years fine -
https://github.com/amarchen/Wikipedia/blob/master/src/qml/components/DbDictionary.qml
Nowadays I would have started with wrapping QSettings though (and pull
requests to Wikipedia for changing LocalStorage use into QSettings wrapper
are welcome :))
Best regards,
Artem.
On Sat, Dec 28, 2013 at 7:45 PM, Kimmo Lindholm <Kimmo.Lindholm at eke.fi>wrote:
> I did it like this with QSettings, it works. I don't know is it the
> correct way... (comments anyone?)
>
> introduce me in main()
> QCoreApplication::setOrganizationDomain("diibadaaba");
> QCoreApplication::setOrganizationName("diibadaaba ");
> QCoreApplication::setApplicationName("badbreath");
> QCoreApplication::setApplicationVersion("0.1-1");
>
> read
> QSettings settings;
> m_mySetting = settings.value("mySetting", "").toString();
>
> write
> QSettings settings;
> settings.setValue("mySetting", m_mySetting);
>
> -kimmo
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
>
--
Artem Marchenko
http://agilesoftwaredevelopment.com
http://twitter.com/AgileArtem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20131228/8382eaee/attachment.html>
More information about the Devel
mailing list