diff options
author | Jim Albamont <jim.albamont@kdab.com> | 2019-03-13 13:23:21 -0500 |
---|---|---|
committer | James Turner <james.turner@kdab.com> | 2019-04-04 09:15:50 +0000 |
commit | bf2c2e9bb2dd0b13cb2cb6728de0c2421fbafbb7 (patch) | |
tree | 27ac13c4706c134ae476071a6b8b9646ac97ee35 /tests/manual/manual.pro | |
parent | f0f5a2de1da2e05e3587d2a6486687ebbe649339 (diff) |
Fix Entity parenting hierarchy
When the initial Entity backend node hierarchy is created it skips over
any non-entity nodes to ensure that Entities are only parented to
other Entities. Calling QNode::setParent breaks this when reparenting
Entities to non-entity nodes.
Fix by sending a new "parentEntityUpdated" property update that backend
Entity nodes listen for. They keep the id of their new parent and flag
the need to rebuild the entity hierarchy. This triggers a new job to
clear the children and parents of every backend Entity, then rebuilds
the hierarchy using the stored parent ID in each Entity. This is much
more forgiving of creation/parenting ordering issues and shouldn't be
less performant because any Entity reparent was previously marking
everything dirty anyway.
Add a new test from QTBUG-73905 that creates 4 cylinders and manipulates
the parents in different ways.
Add a new test to tst_nodes to reparent a QEntity to a QNode and ensure
the entity finds it's correct QEntity parent.
Add a new test to tst_entity to ensure backend nodes correctly handle
the new parenting events.
Task-number: QTBUG-73905
Change-Id: Iab0203947d89bbed2868b3629fbde879675fe568
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/manual/manual.pro')
-rw-r--r-- | tests/manual/manual.pro | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro index 6666245ca..4900add69 100644 --- a/tests/manual/manual.pro +++ b/tests/manual/manual.pro @@ -13,6 +13,7 @@ SUBDIRS += \ custom-mesh-update-data-cpp \ custom-mesh-update-data-qml \ cylinder-cpp \ + cylinder-parent-test \ cylinder-qml \ deferred-renderer-cpp \ deferred-renderer-qml \ |