STreeView

Forward declaration.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/Views/STreeView.h

Include

#include "Widgets/Views/STreeView.h"

Syntax

template<typename ItemType>
class STreeView : public SListView< ItemType >

Remarks

This assumes you are familiar with SListView; see SListView.

TreeView setup is virtually identical to that of ListView. Additionally, TreeView introduces a new delegate: [OnGetChildren()](API\Runtime\Slate\Widgets\Views\STreeView\OnGetChildren). [OnGetChildren()](API\Runtime\Slate\Widgets\Views\STreeView\OnGetChildren) takes some DataItem being observed by the tree and returns that item's children. Like ListView, TreeView operates exclusively with pointers to DataItems.

Variables

Name Description

Protected variable

TArray< FItemIn...

 

DenseItemInfos

Info needed by every item in the linearized version of the tree.

Protected variable

TArray< ItemTyp...

 

LinearizedItems

A linearized version of the items being observed by the tree view.

Protected variable

FOnExpansionCha...

 

OnExpansionChanged

The delegate that is invoked whenever an item in the tree is expanded or collapsed.

Protected variable

FOnGetChildren

 

OnGetChildren

The delegate that is invoked whenever we need to gather an item's children.

Protected variable

FOnSetExpansion...

 

OnSetExpansionRecursive

The delegate that is invoked to recursively expand/collapse a tree items children.

Protected variable

TSparseItemMap

 

SparseItemInfos

Info needed by a small fraction of tree items; some of these are not visible to the user.

Protected variable

const TArray< I...

 

TreeItemsSource

A pointer to the items being observed by the tree view.

Constructors

Name Description

Public function

STreeView()

Default constructor.

Functions

Name Description

Public function

void

 

ClearExpandedItems()

Clears the entire set of expanded items.

Public function

void

 

Construct

(
    const FArguments& InArgs
)

Construct this widget

Public function Const

void

 

GetExpandedItems

(
    TItemSet& ExpandedItems
)

Generates a set of items that are currently expanded.

Public function Const

bool

 

IsItemExpanded

(
    const ItemType& InItem
)

Public function

bool

 

PopulateLinearizedItems

(
    const TArray< ItemType >& InItemsS...,
    TArray< ItemType >& InLinearizedIt...,
    TArray< FItemInfo >& NewDenseItemI...,
    TBitArray<> NeedsParentWire,
    TItemSet& OutNewSelectedItems,
    TSparseItemMap& NewSparseItemInfo,
    bool bAddingItems,
    int32 ParentIndex
)

Given: an array of items (ItemsSource) each of which potentially has a child.

Public function

void

 

RequestTreeRefresh()

Public function

void

 

SetItemExpansion

(
    const ItemType& InItem,
    bool InShouldExpandItem
)

Set whether some data item is expanded or not.

Public function

void

 

SetSingleExpandedItem

(
    const ItemType& InItem
)

Collapse all the items in the tree and expand InItem

Public function

void

 

SetTreeItemsSource

(
    const TArray< ItemType >* InIt...
)

Set the TreeItemsSource. The Tree will generate widgets to represent these items.

Overridden from SListView

Name Description

Public function Virtual

TSharedRef< ...

 

GenerateNewWidget

(
    ItemType InItem
)

Given a TreeItem, create a Widget to represent it in the tree view.

Overridden from STableViewBase

Name Description

Public function Virtual

void

 

RebuildList()

Completely wipe existing widgets and fully regenerate them on next tick.

Public function Virtual

void

 

RequestListRefresh()

Queue up a regeneration of the linearized items on the next tick.

Overridden from SWidget

Name Description

Public function Virtual

FReply

 

OnKeyDown

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is pressed when this widget has focus (this event bubbles if not handled)

Public function Virtual

void

 

Tick

(
    const FGeometry& AllottedGeometry,
    const double InCurrentTime,
    const float InDeltaTime
)

See SWidget::Tick()

Overridden from ITypedTableView

Name Description

Public function Virtual

void

 

Private_SignalSelectionChanged

(
    ESelectInfo::Type SelectInfo
)

Notify the ItemsWidget that we changed its selection.

Classes

Name

Description

Public struct

FArguments

Typedefs

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