Re: Menubar implementation
I haven't looked at the menu bar implementation,. but usually the type that handles "children" is QQmlListProperty.
Cheers,
_
Re: Menubar implementation
Yes, that i figured out. There is a QProperty in the QQuickMenuBar "menus" which is indeed a QQmlListProperty. The MenuBar control uses this in a repeater to visualize the menu. That I already understood, but what I don't understand is how that QQmlListProperty is populated with the childcomponents that you define in your MenuBar...
Jan
Re: Menubar implementation
That "menus" property is likely marked as the "default" property, so writing this
Code:
MenuBar {
Menu {}
Menu {}
}
is equivalent to
Code:
MenuBar {
menus: [ Menu {}, Menu {} ]
}
Two instance of Menu get created and appended to the "menus" QQmlListProperty.
Cheers,
_
Re: Menubar implementation
Yes, that's it probably. In the qquickmenubar I see: Q_CLASSINFO("DefaultProperty", "menus"). I didn't know about the default property.
Thanks!
Jan