[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: KApplication::cut()....
From: Joseph Wenninger <jowenn () kde ! org>
Date: 2005-09-23 13:22:21
Message-ID: 200509231522.21770.jowenn () kde ! org
[Download RAW message or body]
Hi !
1) Why do I have to retrieve the action object, if I just want to cut or copy
from the currently focused widget ? The focus widget doesn't have to be the
mainwindow, but could be a child widget, right ? Ok, the advantage would be
that you don't have to call the slots cut/copy/paste, ...
2) If there are methods like createAutomaticCutActions, they should check if
the action collection already has a cut action and only create a new one , if
it doesn't , otherwise return the already existing
Kind regards
Joseph Wenninger
Am Freitag, 23. September 2005 15:02 schrieb Benjamin Meyer:
[SNIP]
> > Why bother with having those functions public at all? Most of the time
> > you just want to get the action object, and for those it definitely makes
> > sense to bind them to a mainwindow.
> >
> > Simon
>
> What functions something like this:
>
> /**
> * If the widget with focus provides a cut() slot, call that slot.
> Thus for a
> * simple application cut can be implemented as:
> * \code
> * createAutomaticCutAction(actionCollection());
> * \endcode
> */
> KAction *createAutomaticCutAction(KActionCollection *collection) const;
>
>
> KAction *KMainWindow::createAutomaticCutAction(KActionCollection
> *collection) const
> {
> return KStdAction::cut( this, SLOT( invokeEditSlot( SLOT( cut() ) ) ),
> collection );
> }
>
> -Benjamin Meyer
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic