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

List:       kfm-devel
Subject:    Re: Bug#4656: konqueror : Default keys to delete files
From:       Dawit Alemayehu <adawit () kde ! org>
Date:       2000-06-29 19:19:02
[Download RAW message or body]


On Thu, 29 Jun 2000, David Faure wrote:
> On Wed, Jun 28, 2000 at 11:52:04PM -0400, Dawit Alemayehu wrote:
> > On Sun, 18 Jun 2000, David Faure wrote:
> > > Maybe the accel triggering happens BEFORE the event is sent to widgets ?
> > 
> > Well I finally had a chance to take a closer look at this.  It turns out the
> > problem is QAccel.  It actually consumes the key events associated with the
> > accelerators after emitting an activated(..) signal.  Hence, the event is never
> > propagated past the top level widget.  Actually the emition of the activated
> > signal  is also a problem.  I have attached a patch that will help solve this
> > issue at the source rather than hacking around.  This patch should also work for
> > other apps that need the same flexibility to accomplish the same things.  The
> > only problem is that it has little chance of making it into an official Qt
> > release because it breaks binary compatiability!!  Should I simply send a bug
> > report to the trolls with this patch attached and let them find a better way to deal
> > with it ??  Or does anyone else know a BC way of doing this ??
> > 
> > BTW, with this patch all we had to do to stop accelerator key events in konqy's
> > combobox is to re-implement the enable Accelerator function and return false
> > if the combobox had focus :))
> 
> Thanks for having looked into this.
> I can't comment on the patch, because you forgot half of it I think
> (it has qwidget.h, qwidget.cpp, then again qwidget.h and qwidget.cpp,
> and I guess you had to change some other file to make this work...)

Yes.  qaccel.cpp, but I messed up when I generated the diff to a file.  I have
attached a corrected one below for what it is worth. :)

> I think it's a step in the right direction but TT will probably not
> apply it as is. One reason (besides BC) is that the API isn't self-explanatory.
> QWidget::enableAccelerator should rather be dependent on the key that
> was pressed, no ? You don't want to eat _all_ accelerators, but only those who
> conflict with the widget... Anyway, without the full patch I'm having trouble guessing
> what you intended to do :-)

Ahhh... good point.  I completely missed that.  Break one and fix another. 
Well here is the correct implementation with a new signature...

virtual bool allowAcceleratorEvent( QKeyEvent* );

by default it simply returns true so QAccel continues to operate the way it
always has.  Unfortunately this will not change anything with the patch
being accepted into Qt because of BC issues :((

Regards,
Dawit A.


["qt-copy.tgz" (application/x-gzip)]

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

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