Set event object for wxKeyEvents generated in wxQt
Not setting the event object broke the code expecting it to be set, notably in our own validators code. Closes https://github.com/wxWidgets/wxWidgets/pull/1176
This commit is contained in:
committed by
Vadim Zeitlin
parent
7a42dbd83b
commit
515031cf6b
@@ -1225,6 +1225,7 @@ bool wxWindowQt::QtHandleKeyEvent ( QWidget *WXUNUSED( handler ), QKeyEvent *eve
|
||||
|
||||
// Build the event
|
||||
wxKeyEvent e( event->type() == QEvent::KeyPress ? wxEVT_KEY_DOWN : wxEVT_KEY_UP );
|
||||
e.SetEventObject(this);
|
||||
// TODO: m_x, m_y
|
||||
e.m_keyCode = wxQtConvertKeyCode( event->key(), event->modifiers() );
|
||||
|
||||
@@ -1267,6 +1268,7 @@ bool wxWindowQt::QtHandleKeyEvent ( QWidget *WXUNUSED( handler ), QKeyEvent *eve
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
e.SetEventType( wxEVT_CHAR );
|
||||
e.SetEventObject(this);
|
||||
|
||||
// Translated key code (including control + letter -> 1-26)
|
||||
int translated = 0;
|
||||
|
Reference in New Issue
Block a user