diff options
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp | 4 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsanchorlayout_p.h | 2 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsscene.cpp | 11 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp index 02956b76f9..6a9036997c 100644 --- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp @@ -2096,7 +2096,7 @@ QList<AnchorData *> getVariables(const QList<QSimplexConstraint *> &constraints) void QGraphicsAnchorLayoutPrivate::calculateGraphs( QGraphicsAnchorLayoutPrivate::Orientation orientation) { -#if defined(QT_DEBUG) || defined(Q_AUTOTEST_EXPORT) +#if defined(QT_DEBUG) || defined(QT_BUILD_INTERNAL) lastCalculationUsedSimplex[orientation] = false; #endif @@ -2249,7 +2249,7 @@ bool QGraphicsAnchorLayoutPrivate::calculateTrunk(Orientation orientation, const sizeHints[orientation][Qt::MaximumSize] = ad->sizeAtMaximum; } -#if defined(QT_DEBUG) || defined(Q_AUTOTEST_EXPORT) +#if defined(QT_DEBUG) || defined(QT_BUILD_INTERNAL) lastCalculationUsedSimplex[orientation] = needsSimplex; #endif diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h index ee11cb8561..b6d8a12658 100644 --- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h @@ -579,7 +579,7 @@ public: bool graphHasConflicts[2]; QSet<QGraphicsLayoutItem *> m_floatItems[2]; -#if defined(QT_DEBUG) || defined(Q_AUTOTEST_EXPORT) +#if defined(QT_DEBUG) || defined(QT_BUILD_INTERNAL) bool lastCalculationUsedSimplex[2]; #endif 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; } |