summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Zander <t.zander@nokia.com>2010-06-16 11:54:56 (GMT)
committerThomas Zander <t.zander@nokia.com>2010-06-16 12:29:06 (GMT)
commit47d3d5569e25d0e88259e1f0448d87325da0ab6a (patch)
treebd9285904d50266a5496015b1f2782ed8d079aad /src
parent7e08ce215763475c5933d2f035687e5db3d5295d (diff)
downloadQt-47d3d5569e25d0e88259e1f0448d87325da0ab6a.zip
Qt-47d3d5569e25d0e88259e1f0448d87325da0ab6a.tar.gz
Qt-47d3d5569e25d0e88259e1f0448d87325da0ab6a.tar.bz2
Make sure only started gestures can cause cancellations
The design is that calling setGestureCancelPolicy on the gesture that is in starting state, and is accepted can cause other gestures to be cancelled. So change the logic to follow this, which means we won't try to execute the cancel strategy if the gesture was never accepted and avoid the crash detailed in the task. Reviewed-by: Denis Task-number: QTBUG-9771
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 6c5623e..ca3b56f 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -6277,7 +6277,8 @@ void QGraphicsScenePrivate::cancelGesturesForChildren(QGesture *original)
{
Q_ASSERT(original);
QGraphicsItem *originalItem = gestureTargets.value(original);
- Q_ASSERT(originalItem);
+ if (originalItem == 0) // we only act on accepted gestures, which implies it has a target.
+ return;
// iterate over all active gestures and for each find the owner
// if the owner is part of our sub-hierarchy, cancel it.