Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt4-preview-feedback Archive, April 2008
QT 4.4 rc-1 Event Handling is different from 4.3


Message 1 in thread

Gentlepersons,

Have discovered some differences between 4.3 and 4.4rc1 that induced 
bugs into my application. Yikes.

Here's the situation. I have a QMainWindow and a QTextEdit control, both 
of which are subclassed so we can intercept events. We are intercepting 
events to do some special keyboard handling. In 4.3 when keyboard focus 
is on the edit control, the main window does *not* receive keyboard 
events for the edit control. Unfortunately, our app was dependent on 
this behaviour. Unfortunate because in 4.4 rc1, the main window *does* 
receive these events -- hence the bug.

The attached zip file is a complete minimalist MSVC 2005 project that 
exhibits this behaviour. The attached text file shows the different 
debug output betwixt the two versions. Items that begin with "EVENT" are 
unexpected.

I think the 4.3 behaviour is correct. If the QMainWindow needs to see 
the events for a child control, an eventFilter can be used. If I'm 
mistaken in this assertion, someone please let me know.

respectfully,
Jim Thompson

Attachment:

Attachment: qt4.4test.zip
Description: Binary data

Debug Output results from 4.4 rc-1

MyTextEdit keyboard event 6 "" 
MyTextEdit keyboard event 7 "a" 
EVENT key event 
EVENT Text Edit ::key event 
MyTextEdit Event 51 
MyTextEdit keyboard event 6 "a" 
MyTextEdit keyboard event 7 "as" 
EVENT key event 
EVENT Text Edit ::key event 
MyTextEdit Event 51 
MyTextEdit keyboard event 6 "as" 
MyTextEdit keyboard event 7 "asd" 
EVENT key event 
EVENT Text Edit ::key event 
MyTextEdit Event 51 
MyTextEdit keyboard event 6 "asd" 
MyTextEdit keyboard event 7 "asdf" 
EVENT key event 
EVENT Text Edit ::key event 

Debug Output results from 4.3

MyTextEdit keyboard event 6 "" 
MyTextEdit keyboard event 7 "a" 
MyTextEdit Event 51 
MyTextEdit keyboard event 6 "a" 
MyTextEdit keyboard event 7 "as" 
MyTextEdit Event 51 
MyTextEdit keyboard event 6 "as" 
MyTextEdit keyboard event 7 "asd" 
MyTextEdit Event 51 
MyTextEdit keyboard event 6 "asd" 
MyTextEdit keyboard event 7 "asdf"