[PATCH] fix line edit in ksirc

Ellis Whitehead ellis at kde.org
Sun Nov 24 09:33:56 GMT 2002


On Saturday 23 November 2002 17:37, Andrew Stanley-Jones wrote:
> ahistlineedit in ksirc may be a bit fishy and odd, but the underlying
> problem isn't there.  The reason ksirc acts funny under shift-key
> combination is due to it receive 2 events for every key press.
>
> I've dumped the events out and tried to find any differences in them but I
> can't.  My first guess at a work around was to filter out one of them, but
> I can't.  This multiple accel events is a bug somewhere higher up in kde.
>
> Shift-backspace is simply an example, presumably it's supposed to work
> just like backspace.  Try shift-left shift-right, etc.  Hard to select 1
> character that way.  Shift-ins is even more fun.
>
> The patch seems to work, it solves the problem for now in kSirc.
>
> -Andrew

Whenever a widget processes a key via QEvent::AccelOverride, it must set  
QKeyEvent::accepted() so that Qt knows that it was processed.  ahistlineedit 
did this with the accels it processed explicitly, but didn't do this with any 
keys that were processed by QLineEdit.  For example, press Alt+C and you'll 
get both a 'c' in QLineEdit (bug in QLineEdit for which I submitted a patch 
to Trolltech over six months ago...) _and_ the "Channel" menu becomes 
activated.

The reason that the Shift+Left key causes a problem now is because of a change 
in kdelibs which sometimes checks AccelOverride twice.  This will be fixed in 
3.2, but for now it only causes a problem when the widget that processes a 
key in AccelOverride doesn't properly let Qt know that by setting 
QKeyEvent::accepted().

I'll go ahead and commit the patch.  I'm leaving town for a week today and 
will have almost no email access, so if there are any other issues, I'm 
afraid I won't be able to take a look at them until next weekend.

Cheers,
Ellis




More information about the kde-core-devel mailing list