diff options
author | Liang Qi <liang.qi@qt.io> | 2016-09-29 07:42:39 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-09-29 07:42:39 +0000 |
commit | 75aea3ff5eec4a5c8f4184e14a90f4a5e3a577b0 (patch) | |
tree | fcf23325ec038627de8861c9e8f9a4aa2223feef /src/widgets/graphicsview/qgraphicsscene.cpp | |
parent | 433e5ccf507fc153db589df80655618f241af0c3 (diff) | |
parent | cdb56c42fc1145ad25560720fb95df2bfa760a20 (diff) |
Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsscene.cpp')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsscene.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index aa781e8f8b..5b46eb35be 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -717,10 +717,11 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item) ++it; } - QGraphicsObject *dummy = static_cast<QGraphicsObject *>(item); - cachedTargetItems.removeOne(dummy); - cachedItemGestures.remove(dummy); - cachedAlreadyDeliveredGestures.remove(dummy); + if (QGraphicsObject *dummy = item->toGraphicsObject()) { + cachedTargetItems.removeOne(dummy); + cachedItemGestures.remove(dummy); + cachedAlreadyDeliveredGestures.remove(dummy); + } foreach (Qt::GestureType gesture, item->d_ptr->gestureContext.keys()) ungrabGesture(item, gesture); @@ -996,7 +997,7 @@ void QGraphicsScenePrivate::ungrabMouse(QGraphicsItem *item, bool itemIsDying) // If the item is a popup, go via removePopup to ensure state // consistency and that it gets hidden correctly - beware that // removePopup() reenters this function to continue removing the grab. - removePopup((QGraphicsWidget *)item, itemIsDying); + removePopup(popupWidgets.constLast(), itemIsDying); return; } |