Let's say I have 2 types of custom elements — Parent and Child.
And there can be more than one Parent in the scene.
A simple scene looks like this:
Parent { Child { id: child1 } Child { id: child2 }}
After the scene is loaded, I want to initialize all the Children in Parent class:
void InitializeChildren() { list = findChildren<Child*>(QString(),Qt::FindChildrenRecursively); foreach(Child * child,list) { InitChild(this,child);}
But it fails with a more complicated scene:
Parent { Rectangle { Repeater { model: 10 delegate: Child { } } } }
Just because the Repeater has no Child objects as children.
How can I get all Child's objects if I know exactly that they are nested children of the specified Parent?