[Qt-interest] About stop processing key events while QLineEdit evaluates

Zeljko zeljko at holobit.net
Fri Oct 28 07:51:21 CEST 2011


John Weeks wrote:

> I have a similar situation of a QLineEdit in a spread-sheet-like window where
> I need to control what happens with certain key events. I installed an event
> filter on the QLineEdit, check for key press events, and check the key codes.
> If they are key codes I want to control, I handle them there and block the
> event going to the QLineEdit.

Yes, I already have that, but point is that pressing eg return key in my case 
selects next lineedit, so this one is loosing focus and then I evaluate it.
I think that I must make some kind of lock (eg. bool) in application event 
filter so when evaluated edit starts evaluation it sets lock to true, and when 
eval is finished it returns lock in normal state. So then in app event filter I 
need to check such lock and bypass repeated keypresses until lock becomes false 
... that's current idea...I'll try to implement it like that and see if that 
scenario helps.

zeljko





More information about the Qt-interest-old mailing list