Navigation
API > API/Runtime > API/Runtime/Slate > API/Runtime/Slate/STreeView
Description
Given: an array of items (ItemsSource) each of which potentially has a child. Task: populate the LinearizedItems array with a flattened version of the visible data items. In the process, remove any items that are not visible while maintaining any collapsed items that may have expanded children.
| Name | PopulateLinearizedItems |
| Type | function |
| Header File | /Engine/Source/Runtime/Slate/Public/Widgets/Views/STreeView.h |
| Include Path | #include "Widgets/Views/STreeView.h" |
bool PopulateLinearizedItems
(
TArrayView < const ItemType > InItemsSource,
TArray < ItemType > & InLinearizedItems,
TArray < FItemInfo > & NewDenseItemInfos,
TBitArray <> NeedsParentWire,
TItemSet & OutNewSelectedItems,
TSparseItemMap & NewSparseItemInfo,
bool bAddingItems,
int32 ParentIndex
)
true if we encountered expanded children; false otherwise.
Parameters
| Name | Remarks |
|---|---|
| ItemsSource | An array of data items each of which may have 0 or more children. |
| LinearizedItems | Array to populate with items based on expanded/collapsed state. |
| NewDenseItemInfos | Array representing how nested each item in the Linearized items is, and whether it has children. |
| TreeLevel | The current level of indentation. |
| OutNewSelectedItems | Selected items minus any items that are no longer observed by the list. |
| NewSparseItemInfo | Expanded items and items that have expanded children minus any items that are no longer observed by the list. |
| bAddingItems | Are we adding encountered items to the linearized items list or just testing them for existence. |
| ParentIndex | The index in the resulting linearized item list of the parent node for the currently processed level. |