Shortcuts / konsolepart conflict

Anders Lund anders at alweb.dk
Sat Mar 29 20:37:24 GMT 2008


On lørdag 29 Marts 2008, Michael Jansen wrote:
> Am Samstag 29 März 2008 11:18:31 schrieb Anders Lund:
> > On lørdag 29 Marts 2008, Eduardo Robles Elvira wrote:
> > > Some time ago David Faure told me that this should be fixed with Qt 4.4
> > > because it has support for WidgetWithChildrenShortcut. I'm using Qt 4.4
> > > with trunk and it's not fixed though, so the fix is not automatic or
> > > it's not working. I was also told that all this have to do with KAccel
> > > not being in use in KDE anymore.
> >
> > AFAIK the new kded shortcut module prevents it from working. But I may be
> > wrong, which is one of the reasons for my mail :)
>
> I'm pretty sure that's not the case.
>
> But i think we can work this out. There are 4 contexts for shortcuts. ( see
> docu of Qt::ShortcutContext )
>
> And as i could see from the code all shortcuts were changed to
> Qt::WidgetWithChildrenShortcut. But i can't figure out why? The description
> states clearly that it only prevents a shortcut to be valid over the
> boundaries of top level widgets. In kate i can't see where top level
> widgets should be involved. Because i see the term top level widget in the
> qt documentation but no explanation i can only guess what a top level
> widgets is. widgets with th either dialog, window or popup type. Some
> others from Qt::WindowFlags are not valid for the case here.  It's
> explicitly stated that popups don't count as top level widgets for the
> shortcut context so we are left with two. But none of them apply here.
>
> The kate konsole is just a widget because kparts are just widgets and a
> child of the mainwindow. So setting this shortcut context should makes no
> difference. For the fun of it go to kateconsole.cpp line 181 and insert
> m_part->widget()->setWindowFlags( Qt::Window ); . The konsole will be a
> standalone window and the shortcut work as expected.
>
> I'm pretty sure this is not solvable with some Qt Flags.

That would be great :-)

Remember that this affects other applications than kate, dolphin for example 
is also affected.

The requirement is that a shortcut is sent to the konsole widget, so that has 
the chance of using it and stopping the event from being sent to the 
mainwindow.


-- 
Anders

www: http://www.alweb.dk
jabber: anderslund at jabber.dk




More information about the kde-core-devel mailing list