I have a tree component. The items
property of the tree can be periodically updated by actions on the screen that the user can take.
The selectionData
property on the tree contains the data of the currently selected element. However, this property only refreshes its values when the user clicks on the item within the tree, not when the tree's data stored within the items
property changes.
How can I configure selectionData
to refresh itself by any means other than manually clicking the tree? I've tried quickly changing the selection paths on the tree via the scrip below, but this was ineffective:
current_selection_path = str(self.getChild("Tree").props.selection[0])
self.getChild("Tree").props.selection[0] = '0'
self.getChild("Tree").props.selectionData[0].itemPath = '0'
self.getChild("Tree").props.selection[0] = current_selection_path
self.getChild("Tree").props.selectionData[0].itemPath = current_selection_path