In my application I have a normal QML tree with several child nodes below the root element. The application calls for some of the sub trees being visible sometimes and others at other times. One approach I have tried is to setParentItem to null for the sub tree I want hidden (to avoid fireing visibleChange events), saving ptr reference for future connection with root element. Problem I have is that Qt's garbage collector then kicks in and frees all nodes in the sub tree.
Can this be avoided somehow?