diff options
author | Gunnar Sletta <gunnar@sletta.org> | 2015-01-05 12:38:18 +0100 |
---|---|---|
committer | Gunnar Sletta <gunnar@sletta.org> | 2015-01-05 15:26:38 +0100 |
commit | 01cb25953d086e299b235a49853c7410c062e4c9 (patch) | |
tree | 3cea0d3d114ebda727d408af61f71f9f0ab4c0a2 /src/quick/scenegraph/coreapi/qsgnode.cpp | |
parent | c7ab634fc7aba84771586d782decd27db19650bf (diff) |
Traverse children correctly when reparenting.
Since the children are being removed from the parent, using
nextSibling on the child won't work. We need to extract the
first child from the parent until there are no more children
left.
Change-Id: Ifca5f2760e2b1c7ba56c198623c5dc9d82c7560f
Task-number: QTBUG-42530
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgnode.cpp')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgnode.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp index 29e661c454..bb22eee5d1 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.cpp +++ b/src/quick/scenegraph/coreapi/qsgnode.cpp @@ -584,7 +584,7 @@ void QSGNode::reparentChildNodesTo(QSGNode *newParent) { Q_ASSERT_X(!newParent->parent(), "QSGNode::reparentChildNodesTo", "newParent is already part of a hierarchy"); - for (QSGNode *c = firstChild(); c; c = c->nextSibling()) { + for (QSGNode *c = firstChild(); c; c = firstChild()) { removeChildNode(c); newParent->appendChildNode(c); } |