TreeView of UE4UMG

1. What is it used for:

It belongs to the tree list in the list category. (Structure similar to the hierarchical relationship of UMG controls)

2. Summary of the use process:

Create a treeview control in the mother UI, then create a new UMG blueprint, find the button to add an interface in the class settings in the new UMG, add the User Object List Entry interface, and then enter the EntryWidgetClass in the treeview in the mother UI Found the new UMG.

Then create an Object class, store the data of the new UMG in it, and create the corresponding variable type (you need to have a variable that distinguishes the hierarchical relationship and an array that stores the subtree Object object).

Create a recursive function in the object class, and pay attention to constraining the number of recursions with hierarchical relationships. Each layer recursively builds a new object class and stores it in the object group of the parent tree.

Then bind the onGetItemChildren function in the treeview control, and pass out the object group in the Item of the root node, so that each level of child nodes will be generated traversally.

Finally, generate the first-level tree in the parent UI, and that's it. (The above omits the data correspondence in the child node UMG, which is completed in the event OnListItemObejectSet.)

3. Corresponding process example:

 

 

 

 

 

Guess you like

Origin blog.csdn.net/WindRushNight/article/details/125330052