[Qt] Qt Key events

zeljko zeljko at holobit.net
Sat May 26 19:37:24 CEST 2007


On Saturday 26 May 2007 17:05, Felipe Monteiro de Carvalho wrote:
> On 5/26/07, zeljko <zeljko at holobit.net> wrote:
> > I've overriden EventFilter() for QtLineEdit, and now got proper KeyPress
> > & KeyUp handling.
>
> If it works, great =) send a patch when you are ready.

yes, it works but in different manner, patch will be created as soon as I 
better understand the way of LCL handling such events.

if I set LclObject.BroadCast(msg) then we get double fire over controls like 
QtLineEdit(), that means thet if OnKeyDown() is assigned we'll get twice same 
key.
Without implementation of EventFilter() per class it's impossible.
Why this don't work in LCL ??
QtWidget have EventFilter() virtual; , I've just overriden it in TQtLineEdit, 
but it's never called, it always calls TQtWidget's EventFilter,
but if I create a hook in TQtLineEdit constructor then it works. I'm not sure 
that I understand LCL perfectly so why overriden method isn't called ?
anyone ?

>
> About SlotKey calling LCLObject.WndProc, well, I just thougth that
> sending this message would make it work, which obviously wasn't the
> case =)

We must use DeliverMessage or Broadcast (I think so), but upper problem makes 
me a bit crazy :)

>
> I think I made that on the other components and it worked, so I stuck
> with the same code.
>
> thanks,

cheers



More information about the Qt mailing list