From 2a2ffa9231ce4f7bcb3c7e4ae93337b9e4cb2772 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 22 May 2009 13:05:49 +0200 Subject: Capture keyboard modifiers for touch events Reviewed-By: Bradley T. Hughes --- src/gui/kernel/qapplication.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index f1c5f34..88b9a66 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -3579,14 +3579,14 @@ bool QApplication::notify(QObject *receiver, QEvent *e) QApplicationPrivate::mouse_buttons |= me->button(); else QApplicationPrivate::mouse_buttons &= ~me->button(); - } -#if !defined(QT_NO_WHEELEVENT) || !defined(QT_NO_TABLETEVENT) - else if ( + } else if (e->type() == QEvent::TouchBegin + || e->type() == QEvent::TouchUpdate + || e->type() == QEvent::TouchEnd # ifndef QT_NO_WHEELEVENT - e->type() == QEvent::Wheel || + || e->type() == QEvent::Wheel # endif # ifndef QT_NO_TABLETEVENT - e->type() == QEvent::TabletMove + || e->type() == QEvent::TabletMove || e->type() == QEvent::TabletPress || e->type() == QEvent::TabletRelease # endif @@ -3594,7 +3594,6 @@ bool QApplication::notify(QObject *receiver, QEvent *e) QInputEvent *ie = static_cast(e); QApplicationPrivate::modifier_buttons = ie->modifiers(); } -#endif // !QT_NO_WHEELEVENT || !QT_NO_TABLETEVENT } if (!d->grabbedGestures.isEmpty() && e->spontaneous() && receiver->isWidgetType()) { -- cgit v0.12