Multiple main window support, and action-collections

David Nolden david.nolden.kdevelop at art-master.de
Sun Jul 26 20:26:05 UTC 2009


Am Sonntag 26 Juli 2009 21:52:50 schrieb David Nolden:
> Am Sonntag 26 Juli 2009 20:26:34 schrieb Andreas Pakulat:
> > One thing I'm not sure right now is wether a given KAction can be added
> > to multiple clients/action collections. IIRC KActionCollection does a
> > setParent (don't have the sources at hand), so we'd need need to "clone"
> > actions...
>
> No they cannot. That's exactly the problem I'm talking about. There is no
> way around creating new actions for each mainwindow as it seems. That
> mainwindow argument is not exactly needed while creating those actions, but
> I think it's consistent giving it when a method is called
> "createActionsForMainWindow".
Just tested it, no it's not possible to add the same action to the action 
collections of two mainwindows. It has no effect in the second one.

And since KAction is a normal QObject with connections etc., and may have a 
set defaultWidget(), I guess it's not possible to just clone both, including 
all their active connections.

Greetings, David





More information about the KDevelop-devel mailing list