diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-05-07 15:02:14 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-05-10 10:51:36 (GMT) |
commit | 005dc6c7448a724d3df496a1e528199f5a638ce0 (patch) | |
tree | 5b134b9691a03a08e648865dcd052374dd1d9e42 /src/gui/graphicsview | |
parent | 3f45860bfddc886a2f0985faf1a42b921d275caf (diff) | |
download | Qt-005dc6c7448a724d3df496a1e528199f5a638ce0.zip Qt-005dc6c7448a724d3df496a1e528199f5a638ce0.tar.gz Qt-005dc6c7448a724d3df496a1e528199f5a638ce0.tar.bz2 |
Fixes a crash in gestures.
This is a partial backport of a fix that was pushed to 4.7
(734ba1f540aaedc4a3558268bd7350c0b15325a4)
Task-number: QT-3349
Reviewed-by: trustme
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 98fc10f..2131993 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -693,6 +693,14 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item) --selectionChanging; if (!selectionChanging && selectedItems.size() != oldSelectedItemsSize) emit q->selectionChanged(); + + QHash<QGesture *, QGraphicsObject *>::iterator it; + for (it = gestureTargets.begin(); it != gestureTargets.end();) { + if (it.value() == item) + it = gestureTargets.erase(it); + else + ++it; + } } /*! @@ -5960,7 +5968,8 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) if (gesture->state() == Qt::GestureStarted) startedGestures.insert(gesture); } else { - gesturesPerItem[target].append(gesture); + if (index->items().contains(target)) + gesturesPerItem[target].append(gesture); } } |