[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KAcceleratorManager: Avoiding clashes for accelerators (&)
From:       Albert Astals Cid <aacid () kde ! org>
Date:       2011-05-15 14:25:09
Message-ID: 201105151525.09646.aacid () kde ! org
[Download RAW message or body]

A Sunday, May 15, 2011, Dominik Haumann va escriure:
> Hi,
> 
> in Kate, we create our Highlighting and Indentation menus on the fly, i.e.
> by using the signal aboutToShow(). We use this signal to avoid creating
> unneccesarily lots of menu items that may never be visible, i.e. kind of a
> lazy loading mechanism.
> 
> We fill the menu by naming menu items: "&" + string
> What happens (of course) is that an accelerator is used multiple times.
> 
> We use KAcceleratorManager to avoid this, but this does not work, since it
> also uses the signal aboutToShow() to check clashes (at least that's the
> theory), see
>   KPopupAccelManager::aboutToShow() in file kacceleratormanager.cpp
> 
> Do you have an idea how to avoid this?

You could change KAcceleratorManager to listen to the QEvent::Show event 
instead of listening to the aboutToShow signal, I think this would delay the 
resolution a bit so it would be done after you set your texts.

Albert

> 
> The bug I'm talking about is https://bugs.kde.org/show_bug.cgi?id=273262
> 
> Thanks for any hints!
> Dominik
> 
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic