[Qt5-feedback] [ExternalEmail] Re: Merging QDeclarative specifics into core QMetaObject
Konstantin Ritt
ritt.ks at gmail.com
Wed Jun 15 16:52:41 CEST 2011
the `DEFAULT` meta-keyword still sounds more reliable (and understandable)
than the `Q_CLASSINFO("DefaultProperty", "foo")` (which is also
undocumented, I guess)
Konstantin
2011/6/15 Stefan Majewsky <stefan.majewsky at googlemail.com>
> On Wed, Jun 15, 2011 at 2:22 AM, <Craig.Scott at csiro.au> wrote:
> > The notion of the "default" property is already covered by the USER
> keyword in Q_PROPERTY. Is there any reason why QML doesn't simply use that
> instead of requiring a separate DefaultProperty entry in the classinfo? The
> relevant page on QML ("Extending QML Functionalities using C++") describes
> the use of the DefaultProperty entry. Reading over this again, it really
> does seem like an oversight that this was added instead of re-using the USER
> property already available in the metaobject system. I suspect that this
> classinfo feature could be phased out by supporting the DefaultProperty in
> the classinfo if it is present, but fall back to the USER property if
> DefaultProperty is not present. In Qt5, I'd then suggest dropping the
> support for DefaultProperty.
>
> There is a difference. Consider a textbox. Like any widget (or QML
> Item, for that matter), I would expect the DEFAULT property to be the
> list of children widgets or items, because this is the natural choice
> given QML's syntax. The USER property, on the other hand, is probably
> "text", as with QLineEdit et al., since this is the main editable
> property of the widget itself (as in Designer). It is also where
> KConfigDialog wants to retrieve entered user data from (the other
> major use of the user property, ask api.kde.org for
> KConfigDialogManager for more info).
>
> As you see, there's quite a semantical difference in USER and DEFAULT
> properties: The USER property is the main feature of the user
> interaction with that object, while the DEFAULT property is best used
> for establishing element hierarchies (in QML).
>
> Greetings
> Stefan
> _______________________________________________
> Qt5-feedback mailing list
> Qt5-feedback at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt5-feedback/attachments/20110615/a2a4b8ff/attachment.html
More information about the Qt5-feedback
mailing list