[Qt-qml] storing data for non connected apps
Bo Thorsen
bo at fioniasoftware.dk
Mon Dec 5 15:39:32 CET 2011
Den 05-12-2011 14:51, Sivan Greenberg skrev:
> Hi List,
>
> I would like to know what is the recommended way now days for data
> storage process and retrieval apps written in preferably, pure QML?
>
> I have and app project that needs to store data when app closes and
> needs to reload it when it is executed again, and/or also store data
> while running in the background.
>
> What is the right QML module to use for that? Is there a recommended
> approach and respective code snippets anywhere?
There is some work on this for Qt 5 AFAIK, but for Qt 4 you don't have it.
My solution has so far been to have a QObject derived class that reads
and writes with QSettings. I expose this singleton object to the qml and
it has properties for each of the settings.
I'm not thrilled about this solution, so if someone else has a better
one, I'd love to hear about it.
If you take a look at the examples, you will see that some of them has
settings in a javascript file. This is basically the same idea as mine,
just done in javascript instead of c++. No better, no worse, IMHO, and
still not great.
Bo Thorsen,
Fionia Software.
--
Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk
More information about the Qt-qml
mailing list