[Development] QConfig update.

Rafael Roquetto rafael.roquetto at kdab.com
Wed Oct 15 13:40:55 CEST 2014


On Wed, Oct 15, 2014 at 12:22:32PM +0200, Milian Wolff wrote:
> On Wednesday 15 October 2014 10:02:59 André Somers wrote:
> 
> <snip>
> 
> > I think settings resemble properties to a very large extend. Perhaps it
> > would, as an alternative to the XML or JSON schemes already suggested,
> > but possible to build on the Qt property system instead for this. It is
> > familiar to developers, does not require a special editor, and allows
> > for using your own code instead of generated boilerplate quite naturally
> > (point 4 above). Perhaps something like:
> > 
> > class AppSettings: public QTypedConfig
> > {
> >     Q_SETTINGS(); // Q_OBJECT, but perhaps with some extra's like the
> > ability to include generated function declarations for getters and setters
> > 
> >     Q_SETTING(int width SETTING "dialog/window-width"  DEFAULT 800);
> > //use generated getter, setter and notify
> >     Q_SETTING(MyCustomType myValue READ myValue  WRITE setMyValue NOTIFY
> > myValueChanged); //use custom getter and setter
> > 
> > public:
> >      AppSettings(QObject* parent = 0);
> > 
> >      MyCustomType myValue() const;
> >      void setMyValue(const MyCustomType& value);
> >      Q_SIGNAL void myValueChanged(const MyCustomValue& value);
> > }
> 
> I like the idea!

+1
-- 
Rafael Roquetto | rafael.roquetto at kdab.com | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4861 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20141015/cdeebeec/attachment.bin>


More information about the Development mailing list