setDefaultShortcutContext in KActionCollection (was: Re: [Konsole-devel] [PATCH] Shortcuts with hidden menu bar)

Hamish Rodda rodda at kde.org
Mon Jul 30 03:33:05 BST 2007


On Sat, 28 Jul 2007 05:13:48 pm Thomas Zander wrote:
> On Wednesday 25 July 2007 15:41:25 Robin Stocker wrote:
> > So, with setDefaultShortcutContext removed, what is the suggested way
> > to get the previous behaviour?
>
> Set it on the actions individually;  remember the default is a
> Qt::WindowShortcut so it works for you out of the box. But basically if
> you need it changed, then do it on your own.  KActionCollection is
> keeping its hands off of that option.
> Which I think is correct; its just a collection afterall.

Actually, setAssociatedWidget and addAssociatedWidget change the shortcut 
context to Qt::WidgetShortcut, to retain compatibility with kde3 KAccel.  Now 
that these extra methods are removed, there's not really a clean way to do 
this other than setting the shortcut context after the associated widget has 
been set up, or to do the work of *AssociatedWidget by hand.

We could remove this default but it would mean going through all code which 
uses *AssociatedWidget and implementing the widget default where 
*AssociatedWidget is called, when appropriate.

Cheers,
Hamish.
-------------- 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/20070730/df0df46c/attachment.sig>


More information about the kde-core-devel mailing list