QML introduces a separate ownership (QObject
) tree from the visual tree (QtQuick scene graph).
parent
returns the visual parent.children
returns the visual children.data
returns theQObject
children.
But how do I access the QObject
parent?
FYI, I intend on dynamically creating and destroying nested layouts containing a custom type, so I need to manage the QObject
tree - just using the visual tree will result in the 'wrong' objects disappearing after reparenting and then deleting.