What is needed to be implemented in Qt widgetset so eg. TEdit.OnKeyDown() get fired ?
Messages delivery ? As I can see SlotKey() is called ok, but cannot get anything in OnKeyDown(),OnKeyPress(),OnKeyUp() of any control ...
tnx

Mailing lists / qt / 2007-05
7 messages · 3 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
What is needed to be implemented in Qt widgetset so eg. TEdit.OnKeyDown() get fired ?
Messages delivery ? As I can see SlotKey() is called ok, but cannot get anything in OnKeyDown(),OnKeyPress(),OnKeyUp() of any control ...
tnx
zeljko wroteWhat is needed to be implemented in Qt widgetset so eg. TEdit.OnKeyDown() get fired ? Messages delivery ? As I can see SlotKey() is called ok, but cannot get anything in OnKeyDown(),OnKeyPress(),OnKeyUp() of any control ...
If SlotKey is called, then there is nothing qt specific about the problem. It's a question of knowing which lcl calls to make .... I'd advice to ask this on the main lazarus mailling list, so the LCL experts can see it.
thanks,
http://wiki.lazarus.freepascal.org/LCL_Key_Handling
Mattias
tnx, I've found that in TQtWidget.SlotKey(Event: QEventH); cdecl; is called LCLObject.WndProc(Msg) ?!? why ? I've just changed it with LCLObject.Broadcast(Msg) and now I can get OnKeyXXXX() events in controls (doubled, but I get it ;) ). Felipe ?
On Tue, 22 May 2007 21:47:43 +0200 http://wiki.lazarus.freepascal.org/LCL_Key_Handling…
On Tuesday 22 May 2007 22:03, Mattias Gaertner wrote:
I've overriden EventFilter() for QtLineEdit, and now got proper KeyPress & KeyUp handling.
zeljko wroteI've overriden EventFilter() for QtLineEdit, and now got proper KeyPress & KeyUp handling.
If it works, great =) send a patch when you are ready.
About SlotKey calling LCLObject.WndProc, well, I just thougth that sending this message would make it work, which obviously wasn't the case =)
I think I made that on the other components and it worked, so I stuck with the same code.
thanks,
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 :)
cheers