UTreeView

Similar to ListView, but can display a hierarchical tree of elements.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

UMG

Header

/Engine/Source/Runtime/UMG/Public/Components/TreeView.h

Include

#include "Components/TreeView.h"

Syntax

class UTreeView : public UListView

Remarks

Similar to ListView, but can display a hierarchical tree of elements. The base items source for the tree identifies the root items, each of which can have n associated child items. There is no hard limit to the nesting - child items can have children and so on

To make a widget usable as an entry in a TreeView, it must inherit from the IUserObjectListEntry interface.

Variables

Name Description

Protected variable

TSharedPtr< STr...

 

MyTreeView

Constructors

Name Description

Public function

UTreeView

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

CollapseAll()

Collapses all currently expanded items

Protected function

TSharedRef< ...

 

ConstructTreeView()

STreeView construction helper - useful if using a custom STreeView subclass

Public function

void

 

ExpandAll()

Expands all items with children

Public function

void

 

SetItemExpansion

(
    UObject* Item,
    bool bExpandItem
)

Attempts to expand/collapse the given item (only relevant if the item has children)

Public function

void

 

SetOnGetItemChildren

(
    ObjectT* InUserObject,
    typename TSlateDelegates< UObject&...
)

Public function

void

 

SetOnGetItemChildren

(
    TSharedRef< ObjectT > InUserObject,
    typename TSlateDelegates< UObject&...
)

Overridden from UListViewBase

Name Description

Protected function Virtual

TSharedRef< ...

 

RebuildListWidget()

Implement in child classes to construct the actual ListView Slate widget

Overridden from UVisual

Name Description

Public function Virtual

void

 

ReleaseSlateResources

(
    bool bReleaseChildren
)

Overridden from ITypedUMGListView

Name Description

Protected function Virtual Const

void

 

OnGetChildrenInternal

(
    UObject* Item,
    TArray< UObject* >& OutChildr...
)

TreeViews only.

Protected function Virtual

void

 

OnItemClickedInternal

(
    UObject* Item
)

ListView events - implement these instead of binding handlers directly to a list

Protected function Virtual

void

 

OnItemExpansionChangedInternal

(
    UObject* Item,
    bool bIsExpanded
)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss