From 33f9950996ada06fc39b68f6656b1defdccd8c3a Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Tue, 14 Sep 2010 17:09:56 +0200 Subject: fix QTBUG-13501 - crash when a gesture is accepted but not consumed Reviewed-by: Denis Dzyubenko --- src/gui/kernel/qapplication.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index caeeeb9..2fd2f46 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -4367,11 +4367,13 @@ bool QApplication::notify(QObject *receiver, QEvent *e) eventAccepted = ge.isAccepted(); for (int i = 0; i < gestures.size(); ++i) { QGesture *g = gestures.at(i); - if ((res && eventAccepted) || (!eventAccepted && ge.isAccepted(g))) { + // Ignore res [event return value] because handling of multiple gestures + // packed into a single QEvent depends on not consuming the event + if (eventAccepted || ge.isAccepted(g)) { // if the gesture was accepted, mark the target widget for it gestureEvent->d_func()->targetWidgets[g->gestureType()] = w; gestureEvent->setAccepted(g, true); - } else if (!eventAccepted && !ge.isAccepted(g)) { + } else { // if the gesture was explicitly ignored by the application, // put it back so a parent can get it allGestures.append(g); -- cgit v0.12