[Qt-qml] Tab widget example confusion

warwick.allison at nokia.com warwick.allison at nokia.com
Tue Jul 6 01:26:14 CEST 2010


> the TabWidget makes a huge difference to the working of the example:
> 
>     default property alias content: stack.children

Indeed, you could almost say that line is what it is illustrating. Poorly documented perhaps. ;-)

> Should we be writing more examples like this that do things with the default
> interpretation of elements,

If there are other useful use-cases, yes we should. I can't think of any right now (maybe a pure-QML inefficient Flickable?).

> or was this the only realistic way to achieve the
> desired behavior for this example?

The desired behavior was for the tabs to simply be the children, so this is the only way. Even better would be if the "title" could be an attached property (TabWidget.title: "Red"), but those can't be made for types defined in QML (only those defined from C++).

There are other TabWidgets you could possibly design, but they wouldn't be so simple to use (nor so declarative in style). I think it's better to have a little complexity in the TabWidget to make it simple to use.

--
Warwick




More information about the Qt-qml mailing list