From 1791b29e0be99a27a1d47674d3697f9d03c653e3 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Wed, 8 Feb 2012 12:31:17 +0100 Subject: Fixed QML Item updates after reparenting. Setting an Item's parent to null caused its scene graph nodes to be deleted, but resetting the parent to a valid object did not recreate and update all the nodes. Task-number: QTBUG-21032 Change-Id: I00f93a481a326ba9b9fb98bf4212479622552783 Reviewed-by: Gunnar Sletta --- src/quick/items/qquickcanvas.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickcanvas.cpp b/src/quick/items/qquickcanvas.cpp index cb60a238db..53ff4fd217 100644 --- a/src/quick/items/qquickcanvas.cpp +++ b/src/quick/items/qquickcanvas.cpp @@ -1629,9 +1629,9 @@ void QQuickCanvasPrivate::updateDirtyNode(QQuickItem *item) itemPriv->itemNode()->setMatrix(matrix); } - bool clipEffectivelyChanged = dirty & QQuickItemPrivate::Clip && + bool clipEffectivelyChanged = (dirty & (QQuickItemPrivate::Clip | QQuickItemPrivate::Canvas)) && ((item->clip() == false) != (itemPriv->clipNode == 0)); - bool effectRefEffectivelyChanged = dirty & QQuickItemPrivate::EffectReference && + bool effectRefEffectivelyChanged = (dirty & (QQuickItemPrivate::EffectReference | QQuickItemPrivate::Canvas)) && ((itemPriv->effectRefCount == 0) != (itemPriv->rootNode == 0)); if (clipEffectivelyChanged) { @@ -1731,7 +1731,9 @@ void QQuickCanvasPrivate::updateDirtyNode(QQuickItem *item) itemPriv->clipNode->update(); } - if (dirty & (QQuickItemPrivate::OpacityValue | QQuickItemPrivate::Visible | QQuickItemPrivate::HideReference)) { + if (dirty & (QQuickItemPrivate::OpacityValue | QQuickItemPrivate::Visible + | QQuickItemPrivate::HideReference | QQuickItemPrivate::Canvas)) + { qreal opacity = itemPriv->explicitVisible && itemPriv->hideRefCount == 0 ? itemPriv->opacity : qreal(0); @@ -1777,7 +1779,7 @@ void QQuickCanvasPrivate::updateDirtyNode(QQuickItem *item) } } - if ((dirty & QQuickItemPrivate::PerformanceHints) && itemPriv->groupNode) { + if ((dirty & (QQuickItemPrivate::PerformanceHints | QQuickItemPrivate::Canvas)) && itemPriv->groupNode) { itemPriv->groupNode->setFlag(QSGNode::ChildrenDoNotOverlap, itemPriv->childrenDoNotOverlap); itemPriv->groupNode->setFlag(QSGNode::StaticSubtreeGeometry, itemPriv->staticSubtreeGeometry); } -- cgit v1.2.3