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 | [email protected] | 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
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
