I have recently been using ValueTrees for managing various data throughout a project of mine. I have come across a situation that is slowly driving me crazy though. Through a dialog with various control components, I am setting their values based on the ValueTree properties, and when the user “saves” this information, it writes the values into the same ValueTree properties again.
This all works fine. But I’ve noticed that three of my ValueTree properties will send a change notification through the valueTreePropertyChanged method, even though they haven’t actually changed at all! And to make things even more fun, when performing the same actions again (open dialog, set controls based on ValueTree properties, close and “save” values to same ValueTree), I only have the method called on those properties that actually did change. Basically, the only time I have this false call is on the first change.
I thought maybe I was setting the values into the ValueTree wrong, but all the controls are properly set, and debugging shows that the same values are loaded/set into the ValueTree each time. I can’t figure out what in the world might be causing this. If it matters, the properties are all bools.
Any insight into this would be extremely helpful!