I ended up doing a crazy solution of cloning the tree I need to swap children on, doing the child node swap, and then replacing the tree with the cloned tree. The reason was because ValueTree::copyPropertiesAndChildrenFrom()
would have fired a listener callback for every thing, and doing the tree clone/swap/replace ended up just calling valueTreeRedirected
for the tree root. Since these valueTrees are being used in a TreeView anonymously, there is no means of removing listeners on specific nodes in the tree.
it’s highly un-optimal, and I have no idea what’ll happen when my tree is massive, but it gives me all the behavior with minimal callbacks for tree changes that I needed for this little project:
I will probably abandon the ValueTree as my data structure because the whole callback system triggers way too many callbacks when a deeply nested child is changed.