[Development] Settings API for QML

Alan Alpert 416365416c at gmail.com
Tue Dec 11 23:55:11 CET 2012

On Tue, Dec 11, 2012 at 5:55 AM, Shawn Rutledge
<shawn.rutledge at digia.com> wrote:
> On Mon, Dec 10, 2012 at 07:51:32PM -0800, Alan Alpert wrote:
>> There was a discussion a while ago about a better settings API for
>> QML, http://permalink.gmane.org/gmane.comp.lib.qt.qml/3162 was the
>> best link I could find, but no progress has been made since. The main
>> concensus I got from that thread was just that no one likes QSettings
>> (ancient, file-based) and no one uses local storage (just not simple
>> enough). For just simple, persistent settings there was a need for a
>> new API. And there still is, since I don't think we agreed on an API
>> or location for it.
> Hmm well JsonDB has its issues too.  The nice thing about .ini files
> is they are easy to edit by hand; and the (only?) nice thing about the
> Windows registry is that it's a system-wide standard for which a fall-back
> editor is always available (regedit instead of vi).  So the fact that
> QSettings can transparently support both has always been pretty cool
> in my book.  And I'm not sure what you mean by "nobody uses local storage";
> did you mean that we should try to abstract cloud-based settings too?

What I meant was that I never hear of anyone using the existing QML
functionality for storing application local settings. There's an
import already available called QtQuick.LocalStorage which can save
persistent settings, but because it's a copy of an old HTML5 API it's
just terrible to use (so nobody does). It's reasonable to keep it
around as a local arbitrary SQL database for stuff that might actually
want an SQL DB, like highscores, but it badly needs replacing with
something for just simple settings.

Alan Alpert

More information about the Development mailing list