KAction/KActionCollection proposed changes

Andreas Hartmetz ahartmetz at gmail.com
Sun Oct 28 02:26:07 GMT 2007


Am Sonntag, 28. Oktober 2007 00:34:56 schrieb Hamish Rodda:
> Hi,
>
> In line with the recent discussions on KActionCollection, I present the
> attached patch for review.  It is BIC, and does the following:
>
> 1) Remove setAssociatedWidget, addAssociatedWidget, clearAssociatedWidgets,
> and associatedWidgets.
>
> These methods made KActionCollection make changes on actions added to it,
> and several developers preferred KActionCollection to behave more like a
> container class only (no magic).
>
> 2) Replace the above with associateWidget
>
> This method does the same thing, but on a once-off basis only.  It is a
> very straightforward port and I have almost finished most of kde.
> (BTW I still plan to change the shortcut context to
> Qt::WidgetAndChildContext for 4.4, just can't get to my email at the moment
> to do so)
>
> 3) Change KActionCollection to return a KAction* rather than a QAction* for
> newly created actions.
>
> This is important because calling QAction::setShortcut(s) does not set the
> default shortcut in KAction, as the methods are non-virtual.  So, most apps
> will have misbehaving shortcut config dialogs otherwise.  In the porting
> required for this I have caught many, many bugs.
>
Interesting.

> 4) Override setShortcuts() in KAction as well (same reason as above)
>
>
> If there is consensus I'd like to commit on Monday.
>
As the other developer that I know of who made significant changes to 
KActionCollection between 3 and 4, I agree on all points :)

> BTW, I am also conducting an audit of setShortcut(), the results of which I
> will provide as a patch at a later point.
>
> Cheers,
> Hamish.






More information about the kde-core-devel mailing list