UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TreeFilterHandler< ItemType > Class Template Reference

#include <TreeFilterHandler.h>

Public Types

typedef TSlateDelegates< ItemType >::FOnGetChildren FOnGetChildren
 

Public Member Functions

 TreeFilterHandler ()
 
void SetTreeView (STreeView< ItemType > *InTreeView)
 
void SetFilter (IFilter< ItemType > *InFilter)
 
void SetRootItems (TArray< ItemType > *InRootItems, TArray< ItemType > *InTreeRootItems)
 
void SetGetChildrenDelegate (FOnGetChildren InGetChildrenDelegate)
 
bool GetIsEnabled ()
 
void SetIsEnabled (bool bInIsEnabled)
 
void RemoveCachedItem (ItemType ItemToRemove)
 
void RefreshAndFilterTree ()
 
void OnGetFilteredChildren (ItemType Parent, TArray< ItemType > &FilteredChildren)
 

Detailed Description

template<typename ItemType>
class TreeFilterHandler< ItemType >

Handles filtering and expanding a TreeView using an IFilter implementation.

Member Typedef Documentation

◆ FOnGetChildren

template<typename ItemType >
typedef TSlateDelegates<ItemType>::FOnGetChildren TreeFilterHandler< ItemType >::FOnGetChildren

Constructor & Destructor Documentation

◆ TreeFilterHandler()

template<typename ItemType >
TreeFilterHandler< ItemType >::TreeFilterHandler ( )
inline

Member Function Documentation

◆ GetIsEnabled()

template<typename ItemType >
bool TreeFilterHandler< ItemType >::GetIsEnabled ( )
inline

Gets whether or not filtering is enabled for the TreeView.

◆ OnGetFilteredChildren()

template<typename ItemType >
void TreeFilterHandler< ItemType >::OnGetFilteredChildren ( ItemType  Parent,
TArray< ItemType > &  FilteredChildren 
)
inline

Gets the children for a node in the tree which pass the filter if filtering is enabled, or gets all children if the filter is not enabled. In order for filtering to work correctly this function must be used for the TreeView's OnGetChildren delegate.

◆ RefreshAndFilterTree()

template<typename ItemType >
void TreeFilterHandler< ItemType >::RefreshAndFilterTree ( )
inline

Refreshes the associated TreeView, filtering items if the filter is enabled. When filtering, the expanded state of the items is saved, and when the filter is cleared the pre-filter expand state is restored.

◆ RemoveCachedItem()

template<typename ItemType >
void TreeFilterHandler< ItemType >::RemoveCachedItem ( ItemType  ItemToRemove)
inline

Removes any cached references to an item.

◆ SetFilter()

template<typename ItemType >
void TreeFilterHandler< ItemType >::SetFilter ( IFilter< ItemType > *  InFilter)
inline

Sets the filter which will be used to filter the items in the TreeView.

◆ SetGetChildrenDelegate()

template<typename ItemType >
void TreeFilterHandler< ItemType >::SetGetChildrenDelegate ( FOnGetChildren  InGetChildrenDelegate)
inline

Sets the delegate which should be used for traversing the children of the nodes in the tree.

◆ SetIsEnabled()

template<typename ItemType >
void TreeFilterHandler< ItemType >::SetIsEnabled ( bool  bInIsEnabled)
inline

Sets whether or not filtering the tree is enabled. Calling this DOES NOT refresh the tree, this must be done by calling RefreshAndFilterTree.

◆ SetRootItems()

template<typename ItemType >
void TreeFilterHandler< ItemType >::SetRootItems ( TArray< ItemType > *  InRootItems,
TArray< ItemType > *  InTreeRootItems 
)
inline

Sets the root data arrays for the tree.

Parameters
RootItemsAn array of source root items to be displayed by the tree.
TreeRootItemsThe array of root items which are set as the ItemsSource of the tree. This array will be modified to reflect any filtering.

◆ SetTreeView()

template<typename ItemType >
void TreeFilterHandler< ItemType >::SetTreeView ( STreeView< ItemType > *  InTreeView)
inline

Sets the TreeView to be filtered.


The documentation for this class was generated from the following files: