On 14/06/2011, at 10:19 PM, Stefan Majewsky wrote:

> I was thinking about using QML to define internal datastructures (e.g.
> as a more powerful alternative to QSettings). While doing so, I came
> to wonder whether some of QtDeclarative's custom additions to the
> metaobject framework should be merged into the main macros.
> 
> For example:
>> Q_PROPERTY(QObject* foo READ foo WRITE setFoo NOTIFY fooChanged)
>> Q_CLASSINFO("DefaultProperty", "foo")
> 
> could become:
>> Q_PROPERTY(QObject* foo READ foo WRITE setFoo NOTIFY fooChanged DEFAULT)


+1 for this suggestion. In fact, this was how I expected the default property 
to be defined the first time I was using this aspect of properties of QObject's.

Note also that the Qt documentation still says that Qt itself does not use 
anything defined via Q_CLASSINFO except for the ActiveQt extension, but it 
appears that this is no longer true with QML/QtDeclarative (sorry, can't 
remember the details of where/how, but I'm sure the relevant people will know 
the details). If the DEFAULT keyword/classinfo is absorbed into the Q_PROPERTY 
macro, then at least the Q_CLASSINFO reverts to going back to being just for 
extensions to Qt or client code. Making this change in the break to Qt5 would 
seem the right time to do this. If there's going to be a Qt4 --> Qt5 porting 
tool like there was from 3 --> 4, then it could convert/absorb the 
Q_CLASSINFO("DefaultProperty",...) stuff into the corresponding Q_PROPERTY 
macro.

--
Dr Craig Scott
Computational Software Engineering Team Leader, CSIRO (CMIS)
Melbourne, Australia



_______________________________________________
Qt5-feedback mailing list
Qt5-feedback@qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

Reply via email to