From b2363a935c8dac2c332c79d4c10c99be89656047 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 22 Mar 2012 17:43:25 +0100 Subject: Fix QGuiApplication::keyboardModifiers() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make sure that the keybaord modifiers are maintained properly when handling window system events. Change-Id: Ie75cbe5eb509c29e3d2291694f2de509fbf3098a Reviewed-by: Morten Johan Sørvig Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qapplication.cpp | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index ce57e2868d..2615ac891d 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -3014,34 +3014,14 @@ bool QApplication::notify(QObject *receiver, QEvent *e) // capture the current mouse/keyboard state if(e->spontaneous()) { - if (e->type() == QEvent::KeyPress - || e->type() == QEvent::KeyRelease) { - QKeyEvent *ke = static_cast(e); - QApplicationPrivate::modifier_buttons = ke->modifiers(); - } else if(e->type() == QEvent::MouseButtonPress + if (e->type() == QEvent::MouseButtonPress || e->type() == QEvent::MouseButtonRelease) { QMouseEvent *me = static_cast(e); - QApplicationPrivate::modifier_buttons = me->modifiers(); if(me->type() == QEvent::MouseButtonPress) QApplicationPrivate::mouse_buttons |= me->button(); else QApplicationPrivate::mouse_buttons &= ~me->button(); } -#if !defined(QT_NO_WHEELEVENT) || !defined(QT_NO_TABLETEVENT) - else if (false -# ifndef QT_NO_WHEELEVENT - || e->type() == QEvent::Wheel -# endif -# ifndef QT_NO_TABLETEVENT - || e->type() == QEvent::TabletMove - || e->type() == QEvent::TabletPress - || e->type() == QEvent::TabletRelease -# endif - ) { - QInputEvent *ie = static_cast(e); - QApplicationPrivate::modifier_buttons = ie->modifiers(); - } -#endif // !QT_NO_WHEELEVENT || !QT_NO_TABLETEVENT } #ifndef QT_NO_GESTURES -- cgit v1.2.3