[Development] Settings API for QML

Thiago Macieira thiago.macieira at intel.com
Thu Aug 1 17:33:56 CEST 2013


On quinta-feira, 1 de agosto de 2013 07:58:41, André Somers wrote:
> I do see a use for using a schema right there. Settings can be accessed 
> from all over the application. If you use QSettings or QConfiguration or 
> whatever for that directly, it means that everywhere you need a specific 
> value, you also need the default value. So, you end up duplicating the 
> default value to several places in the code, and it won't be easy to 
> find all occurrences either. If you define the defaults centrally, at 
> least you don't have that issue.

In the past, KDE has solved this problem by processing the schema file (it's 
never been called that in KDE, but turns out it's what the .kcfg files are) and 
generating a nice C++ class to access, with the defaults built-in and the 
proper C++ type safety.

This solves the runtime overhead problem by transferring it to a compile-time 
issue.

Since I'm not convinced, the objection still stands for now: schemas must not 
be a mandatory runtime requirement. They can be present only if optional and 
opt-in.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130801/30eff9a2/attachment.sig>


More information about the Development mailing list