KAction changes

Kevin Ottens ervin at kde.org
Mon Dec 4 07:19:37 GMT 2006


Le lundi 4 décembre 2006 01:55, Andreas Hartmetz a écrit :
> Well, it was planned (by Olivier Goffart and me) to add mouse gesture
> and voice triggers to KAction. From a user's perspective they probably
> don't *need* to be handled by KAction, of course. From a programmer's
> perspective however, this seems to be the only way that makes sense. I
> have not yet done anything to implement voice gestures (and I don't
> know if I will be able to pull it off at all) but mouse gestures are
> actually pretty easy to add to KAction, I tried that. You need a
> KGestureMap (== event filter for KApplication with gesture recognizer)
> for each application and some fields in KAction's private data.

I don't think our current changes avoid doing this. We're leaning toward 
having no state stored in KAction itself and use QObject dynamic properties 
instead. KAction will basically provide the necessary convenience to query 
those properties. So basically if the fields you planned to add in KAction 
private data can be stored in QVariant you'll still be able to add the 
features you planned.

> If everybody stops using KAction, it might become difficult to add any
> additional  triggers to random actions. For example, a user might want
> to add a mouse gesture to an action that does not have a predefined
> gesture.

Note that Simon didn't claim that KAction will be removed. Just that instead 
of using KAction* in our public API we'll use QAction*. Nowadays QMainWindow, 
and for instance QUndo, provides QActions that we can't plug anywhere in our 
classes because all the signatures use KAction*.

In fact, using KActions is important at creation time only (ok, there might be 
a few exceptions but we'll provide convenience for this), after that they can 
be carried as QAction without problems IMO.

Regards.
-- 
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061204/13da8041/attachment.sig>


More information about the kde-core-devel mailing list