On Sun, Dec 16, 2012 at 1:12 PM, Bache-Wiig Jens
<jens.bache-w...@digia.com> wrote:
>> If you create the actions in C++, you'd still have to repeat each and
>> every one in QML, unless we provide a way to iterate over the ones
>> that should be in a menu, or a toolbar.
>
> How about having ToolBar.addAction() for convenience? It is exactly what we 
> do for widgets.

Widgets is a toolkit for an imperative language. Looping over lists
and adding things individually is acceptable there. In a declarative
language it is really not the right way to go. Even if you don't want
to implement menus with ActionGroup, I'd still recommend that you have
something like it (which can take a list of Action/QAction) so that
you only need to list all the actions once, where-ever that may be,
and then add them to other places en masse.

--
Alan Alpert
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to