Navigation
API > API/Runtime > API/Runtime/Slate
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(). OnGetChildren() takes some DataItem being observed by the tree and returns that item's children. Like ListView, TreeView operates exclusively with pointers to DataItems.
| Name | STreeView |
| Type | class |
| Header File | /Engine/Source/Runtime/Slate/Public/Widgets/Views/STreeView.h |
| Include Path | #include "Widgets/Views/STreeView.h" |
Syntax
template<typename ItemType>
class STreeView : public SListView< ItemType >
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → SWidget → SCompoundWidget → STableViewBase → SListView → STreeView
- FSlateControlledConstruction → SWidget → SCompoundWidget → STableViewBase → SListView → STreeView
- TListTypeTraits< T, Enable >::SerializerType → SListView → STreeView
- SListView → STreeView
- STreeView
Implements Interfaces
Derived Classes
STreeView derived class hierarchy
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
STreeView() |
Default constructor. | Widgets/Views/STreeView.h |
Structs
| Name | Remarks |
|---|---|
| FArguments |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FIsSelectableOrNavigable | typename TSlateDelegates< ItemType >::FIsSelectableOrNavigable | Widgets/Views/STreeView.h | |
| FOnExpansionChanged | typename TSlateDelegates< ItemType >::FOnExpansionChanged | Widgets/Views/STreeView.h | |
| FOnGenerateRow | typename TSlateDelegates< ItemType >::FOnGenerateRow | Widgets/Views/STreeView.h | |
| FOnGetChildren | typename TSlateDelegates< ItemType >::FOnGetChildren | Widgets/Views/STreeView.h | |
| FOnItemScrolledIntoView | typename TSlateDelegates< ItemType >::FOnItemScrolledIntoView | Widgets/Views/STreeView.h | |
| FOnItemToString_Debug | typename TSlateDelegates< ItemType >::FOnItemToString_Debug | Widgets/Views/STreeView.h | |
| FOnMouseButtonClick | typename TSlateDelegates< ItemType >::FOnMouseButtonClick | Widgets/Views/STreeView.h | |
| FOnMouseButtonDoubleClick | typename TSlateDelegates< ItemType >::FOnMouseButtonDoubleClick | Widgets/Views/STreeView.h | |
| FOnRefreshRow | typename TSlateDelegates< ItemType >::FOnRefreshRow | Widgets/Views/STreeView.h | |
| FOnSelectionChanged | typename TSlateDelegates< NullableItemType >::FOnSelectionChanged | Widgets/Views/STreeView.h | |
| FOnSetExpansionRecursive | typename TSlateDelegates< ItemType >::FOnSetExpansionRecursive | Widgets/Views/STreeView.h | |
| FOnWidgetToBeRemoved | typename SListView< ItemType >::FOnWidgetToBeRemoved | Widgets/Views/STreeView.h | |
| MapKeyFuncs | typename TListTypeTraits< ItemType >::MapKeyFuncs | Widgets/Views/STreeView.h | |
| MapKeyFuncsSparse | typename TListTypeTraits< ItemType >::MapKeyFuncsSparse | Widgets/Views/STreeView.h | |
| NullableItemType | typename TListTypeTraits< ItemType >::NullableType | Widgets/Views/STreeView.h | |
| TItemSet | TSet< TObjectPtrWrapTypeOf< ItemType >, typename TListTypeTraits< TObjectPtrWrapTypeOf< ItemType > >::SetKeyFuncs > | Widgets/Views/STreeView.h | |
| TSparseItemMap | TMap< ItemType, FSparseItemInfo, FDefaultSetAllocator, MapKeyFuncsSparse > | Widgets/Views/STreeView.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bAllowInvisibleItemSelection | bool | True if we allow invisible items to stay selected. | Widgets/Views/STreeView.h | |
| bHighlightParentNodesForSelection | bool | True if we should highlight all parents for each of the currently selected items | Widgets/Views/STreeView.h | |
| bShouldStackHierarchyHeaders | TAttribute< bool > | True if we want to show the hierarchy of items pinned at the top | Widgets/Views/STreeView.h | |
| bTreeItemsAreDirty | bool | True when the LinearizedItems need to be regenerated. | Widgets/Views/STreeView.h | |
| TreeViewSource | TUniquePtr< UE::Slate::ItemsSource::IItemsSource< ItemType > > | Pointer to the source data that we are observing | Widgets/Views/STreeView.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ClearExpandedItems() |
Clears the entire set of expanded items. | Widgets/Views/STreeView.h | |
void ClearItemsSource() |
Widgets/Views/STreeView.h | ||
void ClearRootItemsSource() |
Widgets/Views/STreeView.h | ||
void Construct
(
const FArguments& InArgs |
Construct this widget | Widgets/Views/STreeView.h | |
void GetExpandedItems
(
TItemSet& ExpandedItems |
Generates a set of items that are currently expanded. | Widgets/Views/STreeView.h | |
TArrayView< const ItemType > GetItems() |
Widgets/Views/STreeView.h | ||
TArrayView< const ItemType > GetRootItems() |
Widgets/Views/STreeView.h | ||
bool HasValidItemsSource() |
Widgets/Views/STreeView.h | ||
bool HasValidRootItemsSource() |
Widgets/Views/STreeView.h | ||
bool IsItemExpanded
(
const ItemType& InItem |
Widgets/Views/STreeView.h | ||
bool PopulateLinearizedItems
(
TArrayView< const ItemType > InItemsSource, |
Given: an array of items (ItemsSource) each of which potentially has a child. | Widgets/Views/STreeView.h | |
int32 PopulatePinnedItems
(
const TArray< ItemType >& InItemsSource, |
Widgets/Views/STreeView.h | ||
void RequestTreeRefresh() |
Widgets/Views/STreeView.h | ||
void SetItemExpansion
(
const ItemType& InItem, |
Set whether some data item is expanded or not. | Widgets/Views/STreeView.h | |
void SetItemsSource
(
TUniquePtr< UE::Slate::ItemsSource::IItemsSource< ItemType > > Provider |
Widgets/Views/STreeView.h | ||
void SetItemsSource
(
TSharedRef<::UE::Slate::Containers::TObservableArray< ItemType > > InListItemsSource |
Widgets/Views/STreeView.h | ||
void SetItemsSource
(
const TArray< ItemType >* InListItemsSource |
Widgets/Views/STreeView.h | ||
void SetRootItemsSource
(
const TArray< ItemType >* InItemsSource |
Set the Root items. The tree will generate widgets to represent these items. | Widgets/Views/STreeView.h | |
void SetRootItemsSource
(
TUniquePtr< UE::Slate::ItemsSource::IItemsSource< ItemType > > Provider |
Establishes a new list of root items being observed by the list. | Widgets/Views/STreeView.h | |
void SetRootItemsSource
(
TSharedRef< UE::Slate::Containers::TObservableArray< ItemType > > InItemsSource |
Set the RootItemsSource. The tree will generate widgets to represent these items. | Widgets/Views/STreeView.h | |
void SetSingleExpandedItem
(
const ItemType& InItem |
Collapse all the items in the tree and expand InItem | Widgets/Views/STreeView.h | |
void SetStyle
(
const FTableViewStyle* InStyle |
Widgets/Views/STreeView.h | ||
void SetTreeItemsSource
(
const TArray< ItemType >* InItemsSource |
Set the TreeItemsSource. The Tree will generate widgets to represent these items. | Widgets/Views/STreeView.h |
Overridden from SListView
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSharedRef< ITableRow > GenerateNewWidget
(
ItemType InItem |
Given a TreeItem, create a Widget to represent it in the tree view. | Widgets/Views/STreeView.h |
Overridden from STableViewBase
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void RebuildList() |
Completely wipe existing widgets and fully regenerate them on next tick. | Widgets/Views/STreeView.h | |
virtual STableViewBase::FReGenerateResults ReGenerateItems
(
const FGeometry& MyGeometry |
Update generate Widgets for Items as needed and clean up any Widgets that are no longer needed. | Widgets/Views/STreeView.h | |
virtual void RequestListRefresh() |
Queue up a regeneration of the linearized items on the next tick. | Widgets/Views/STreeView.h |
Overridden from SWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Widgets/Views/STreeView.h | |||
virtual void Tick
(
const FGeometry& AllottedGeometry, |
See SWidget::Tick() | Widgets/Views/STreeView.h |
Overridden from ITypedTableView
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Private_SignalSelectionChanged
(
ESelectInfo::Type SelectInfo |
Notify the ItemsWidget that we changed its selection. Triggers as OnSelectionChanged(). | Widgets/Views/STreeView.h |