diff options
author | Jeremy Katz <jeremy.katz@nokia.com> | 2010-09-14 15:09:56 (GMT) |
---|---|---|
committer | Jeremy Katz <jeremy.katz@nokia.com> | 2010-09-14 15:17:26 (GMT) |
commit | 33f9950996ada06fc39b68f6656b1defdccd8c3a (patch) | |
tree | 737eeb50fc4815001fd366416425ecc6d3f1e6a2 /src | |
parent | 8401e31e7c0375f9c595678b510b6d2092a2f2e6 (diff) | |
download | Qt-33f9950996ada06fc39b68f6656b1defdccd8c3a.zip Qt-33f9950996ada06fc39b68f6656b1defdccd8c3a.tar.gz Qt-33f9950996ada06fc39b68f6656b1defdccd8c3a.tar.bz2 |
fix QTBUG-13501 - crash when a gesture is accepted but not consumed
Reviewed-by: Denis Dzyubenko
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 6 |
1 files 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); |