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

List:       kde-devel
Subject:    Re: KKeyDialog and KAccel
From:       Ellis Whitehead <kde () ellisw ! net>
Date:       2002-05-02 14:19:26
[Download RAW message or body]

Hi Andi,

> - I need to provide a KActionCollection object, which is unaccessible from
> my central widget.

You can probably create a new KActionCollection the same way you create the 
KAccel object:

- pAccel = new KAccel( pWidget );
+ pCollection = new KActionCollection( pWidget );

Then for individual shortcuts:
- pAccel->insert( ... );
+ new KAction( ..., pCollection );

Do you think this might work for you without having a work-around feel?

> - when I use QWidget::key[Press|Release]Event() it's hard to find out which
> action was used. Best solution seems to be a QMap or a Q*List which store
> the actions in the widget - beside the KMainWindow. Since I can't access
> actionCollection() I can't iterate the accels either.

Hmm...  Could you explain the purpose of keyPressEvent() with shortcuts?  
There are some cases where this is unfortunately necessary, but usually you 
would just provide the accel or action with the slot that it should activate.

> Ok, it's good to know that KAccel should not be used. Once I find a good
> solution for the above problems (the initKeys(actionCollection()) seems to
> be the way to go) I'll port some games in kdegames to use KAction instead.

I'll be interested in hearing what you come up with.

Regards,
Ellis

 
>> 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