summaryrefslogtreecommitdiffstats
path: root/src/core/nodes/qnode_p.h
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2016-05-01 16:31:01 +0100
committerSean Harmer <sean.harmer@kdab.com>2016-05-09 10:21:43 +0000
commitc0b316cb28f9653d9c2ee3443c0e34a314e8cd62 (patch)
tree41da2df4068594a711d0de8cf7b850ff1705709b /src/core/nodes/qnode_p.h
parentd3f9f251d2be89a5a2a6b0e97233c2a6fd72938b (diff)
Set QObject parent immediately and defer backend notifications
This is needed to ensure that subtrees created up front before the aspect engine starts all get added to the scene. This restores correct behavior in cylinder-cpp. With this change all QNode data is correctly set up synchronously upon construction or via setParent(). That is, the scene and arbiter are properly propagated from the parent and the scene is made aware of mappings. Notfications to the backend are deferred until the QNode is fully constructed. Unit tests updated to match this and documentation expanded to capture the details. Change-Id: Ic6b3b46240fdccd67f9526fc3219aac8b7f350f3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/core/nodes/qnode_p.h')
-rw-r--r--src/core/nodes/qnode_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/nodes/qnode_p.h b/src/core/nodes/qnode_p.h
index 231d1ff94..9731138c1 100644
--- a/src/core/nodes/qnode_p.h
+++ b/src/core/nodes/qnode_p.h
@@ -70,6 +70,8 @@ class QT3DCORE_PRIVATE_EXPORT QNodePrivate : public QObjectPrivate, public QObse
public:
QNodePrivate();
+ void init(QNode *parent);
+
void setScene(QScene *scene);
QScene *scene() const;
@@ -97,6 +99,8 @@ public:
static void nodePtrDeleter(QNode *q);
private:
+ void notifyCreationChange();
+ void _q_notifyCreationAndChildChanges();
void _q_addChild(QNode *childNode);
void _q_removeChild(QNode *childNode);
void _q_setParentHelper(QNode *parent);