KApplication::cut()....

Benjamin Meyer ben at meyerhome.net
Fri Sep 23 16:32:14 BST 2005


On Friday 23 September 2005 10:42 am, Simon Hausmann wrote:
> On Friday 23 September 2005 16:50, Benjamin Meyer wrote:
> > On Friday 23 September 2005 9:22 am, Joseph Wenninger wrote:
> > > 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, ...
> >
> > yah having functions named cut() was a bad idea and a bad polution of the
> > name space, I have moved it into the private class
> >
> > > 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
> >
> > If we want that funcionality KStdAction::create should really do that,
> > not createAutomaticCutActions.
> >
> > Ok attached is a new diff.  Let me know what you think.
>
> Looks good to me. But you don't have to make KMainWindowPrivate a QObject
> or add a separate _p.h header file. Just keep everything as it is and add
> to KMainWindow's class declaration at the end:
>
> private:
>     Q_PRIVATE_SLOT(d, void cut());
>     Q_PRIVATE_SLOT(d, void copy());
>     ...
>
> And have the slots as regular methods in the private:
>
> class KMainWindowPrivate
> {
>     ...
>     inline void copy() { invokeEditSlot(SLOT(copy()); }
>     ...
> };
>
> Feel the power of Qt4's moc! ;-)
>
> Simon

Very cool.  Attached is the modified version

-Benjamin Meyer

-- 
aka icefox
Public Key: http://www.icefox.net/public_key.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff
Type: text/x-diff
Size: 11230 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050923/319a22f5/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050923/319a22f5/attachment.sig>


More information about the kde-core-devel mailing list