UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
STreeView.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "InputCoreTypes.h"
8#include "Input/Reply.h"
11#include "Styling/SlateTypes.h"
17#include "Algo/Reverse.h"
18#include "Math/NumericLimits.h"
19
41
42
76
77
88template<typename ItemType>
89class STreeView : public SListView< ItemType >
90{
91public:
92
96
99
110
112
114
115public:
116
118 : _TreeViewStyle(&FAppStyle::Get().GetWidgetStyle<FTableViewStyle>("TreeView"))
121 , _OnRefreshRow()
124 , _MaxPinnedItems(6) // Having more than the max amount of items leads to the extra items in the middle being collapsed into ellipses, and the last item is fully shown
139 , _ScrollBarStyle(&FAppStyle::Get().GetWidgetStyle<FScrollBarStyle>("ScrollBar"))
152 {
154 }
155
156 SLATE_STYLE_ARGUMENT( FTableViewStyle, TreeViewStyle )
157
159
161
163
165
167
169
171
173
175
177
178 SLATE_ATTRIBUTE_DEPRECATED(float, ItemHeight, 5.5, "The ItemHeight is only used for Tile. See ShouldArrangeAsTiles")
179
181
183
185
187
189
191
193
195
197
199
201
203
205
207
209
211
213
215
216 SLATE_ARGUMENT( bool, PreventThrottling )
217
219
221
222 SLATE_ARGUMENT(bool, bEnableShadowBoxStyle)
223
226
228
230
232
234
236
238
241
244
246
247
253 void Construct( const FArguments& InArgs )
254 {
255 this->Clipping = InArgs._Clipping;
256
257 this->OnGenerateRow = InArgs._OnGenerateRow;
258 this->OnGeneratePinnedRow = InArgs._OnGeneratePinnedRow;
259 this->OnRefreshRow = InArgs._OnRefreshRow;
260 this->OnRowReleased = InArgs._OnRowReleased;
261 this->OnItemScrolledIntoView = InArgs._OnItemScrolledIntoView;
262 this->OnGetChildren = InArgs._OnGetChildren;
263 this->OnSetExpansionRecursive = InArgs._OnSetExpansionRecursive;
264
265 this->SetRootItemsSource(InArgs.MakeTreeItemsSource(this->SharedThis(this)));
266
267 this->OnKeyDownHandler = InArgs._OnKeyDownHandler;
268 this->OnContextMenuOpening = InArgs._OnContextMenuOpening;
269 this->OnItemsRebuilt = InArgs._OnItemsRebuilt;
270 this->OnClick = InArgs._OnMouseButtonClick;
271 this->OnDoubleClick = InArgs._OnMouseButtonDoubleClick;
272 this->OnSelectionChanged = InArgs._OnSelectionChanged;
273 this->OnExpansionChanged = InArgs._OnExpansionChanged;
274 this->OnIsSelectableOrNavigable = InArgs._OnIsSelectableOrNavigable;
275 this->SelectionMode = InArgs._SelectionMode;
276
277 this->bClearSelectionOnClick = InArgs._ClearSelectionOnClick;
278 this->ConsumeMouseWheel = InArgs._ConsumeMouseWheel;
279 this->AllowOverscroll = InArgs._AllowOverscroll;
280
281 this->WheelScrollMultiplier = InArgs._WheelScrollMultiplier;
282
283 this->bEnableAnimatedScrolling = InArgs._EnableAnimatedScrolling;
284 this->FixedLineScrollOffset = InArgs._FixedLineScrollOffset;
285
286 this->OnItemToString_Debug = InArgs._OnItemToString_Debug.IsBound()
287 ? InArgs._OnItemToString_Debug
289 this->OnEnteredBadState = InArgs._OnEnteredBadState;
290
291 this->bHandleGamepadEvents = InArgs._HandleGamepadEvents;
292 this->bHandleDirectionalNavigation = InArgs._HandleDirectionalNavigation;
293 this->bAllowInvisibleItemSelection = InArgs._AllowInvisibleItemSelection;
294 this->bHighlightParentNodesForSelection = InArgs._HighlightParentNodesForSelection;
295
296 this->bReturnFocusToSelection = InArgs._ReturnFocusToSelection;
297
298 this->bShouldStackHierarchyHeaders = InArgs._ShouldStackHierarchyHeaders;
299
300 this->SetStyle(InArgs._TreeViewStyle);
301
302 this->SetShadowBoxStyle(InArgs._ShadowBoxStyle);
303 this->bShouldUseShadowBoxStyle = InArgs._bEnableShadowBoxStyle;
304
305 this->MaxPinnedItems = InArgs._MaxPinnedItems;
306 this->DefaultMaxPinnedItems = InArgs._MaxPinnedItems;
307
308 // Check for any parameters that the coder forgot to specify.
309 FString ErrorString;
310 {
311 if ( !this->OnGenerateRow.IsBound() )
312 {
313 ErrorString += TEXT("Please specify an OnGenerateRow. \n");
314 }
315
316 if (!this->HasValidRootItemsSource())
317 {
318 ErrorString += TEXT("Please specify a TreeItemsSource. \n");
319 }
320
321 if ( !this->OnGetChildren.IsBound() )
322 {
323 ErrorString += TEXT("Please specify an OnGetChildren. \n");
324 }
325 }
326
327 if (ErrorString.Len() > 0)
328 {
329 // Let the coder know what they forgot
330 this->ChildSlot
332 .VAlign(VAlign_Center)
333 [
335 .Text(FText::FromString(ErrorString))
336 ];
337 }
338 else
339 {
340 // Make the TableView
341 this->ConstructChildren( 0.0f, 0.0f, EListItemAlignment::LeftAligned, InArgs._HeaderRow, InArgs._ExternalScrollbar, Orient_Vertical, InArgs._OnTreeViewScrolled, InArgs._ScrollBarStyle, InArgs._PreventThrottling );
342 if (this->ScrollBar.IsValid())
343 {
344 this->ScrollBar->SetDragFocusCause(InArgs._ScrollbarDragFocusCause);
345 }
347 }
348 }
349
352 : SListView< ItemType >( ETableViewMode::Tree )
353 , bTreeItemsAreDirty( true )
354 {
356 }
357
358public:
359
360 //~ SWidget overrides
361
362 virtual FReply OnKeyDown( const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent ) override
363 {
364 if (this->OnKeyDownHandler.IsBound())
365 {
366 FReply Reply = this->OnKeyDownHandler.Execute(MyGeometry, InKeyEvent);
367 if (Reply.IsEventHandled())
368 {
369 return Reply;
370 }
371 }
372
373 // Check for selection/expansion toggling keys (Left, Right)
374 // SelectorItem represents the keyboard selection. If it isn't valid then we don't know what to expand.
375 // Don't respond to key-presses containing "Alt" as a modifier
377 {
378 if ( InKeyEvent.GetKey() == EKeys::Left )
379 {
381 {
383 int32 SelectionIndex = this->LinearizedItems.Find( RangeSelectionEndItem );
384
385 if ( Private_DoesItemHaveChildren(SelectionIndex) && Private_IsItemExpanded( RangeSelectionEndItem ) )
386 {
387 // Collapse the selected item
388 Private_SetItemExpansion(RangeSelectionEndItem, false);
389 }
390 else
391 {
392 // Select the parent, who should be a previous item in the list whose nesting level is less than the selected one
393 int32 SelectedNestingDepth = Private_GetNestingDepth(SelectionIndex);
394 for (SelectionIndex--; SelectionIndex >= 0; --SelectionIndex)
395 {
396 if ( Private_GetNestingDepth(SelectionIndex) < SelectedNestingDepth )
397 {
398 // Found the parent
399 this->NavigationSelect(this->LinearizedItems[SelectionIndex], InKeyEvent);
400 break;
401 }
402 }
403 }
404 }
405
406 return FReply::Handled();
407 }
408 else if ( InKeyEvent.GetKey() == EKeys::Right )
409 {
411 {
413 int32 SelectionIndex = this->LinearizedItems.Find( RangeSelectionEndItem );
414
415 // Right only applies to items with children
416 if ( Private_DoesItemHaveChildren(SelectionIndex) )
417 {
418 if ( !Private_IsItemExpanded(RangeSelectionEndItem) )
419 {
420 // Expand the selected item
421 Private_SetItemExpansion(RangeSelectionEndItem, true);
422 }
423 else
424 {
425 // Select the first child, who should be the next item in the list
426 // Make sure we aren't the last item on the list
428 {
429 this->NavigationSelect(this->LinearizedItems[SelectionIndex + 1], InKeyEvent);
430 }
431 }
432 }
433 }
434
435 return FReply::Handled();
436 }
437 }
438
440 }
441
442private:
443
444 //~ Tree View adds the ability to expand/collapse items.
445 //~ All the selection functionality is inherited from ListView.
446
447 virtual bool Private_IsItemExpanded( const ItemType& TheItem ) const override
448 {
450 return ItemInfo != nullptr && ItemInfo->bIsExpanded;
451 }
452
453 virtual void Private_SetItemExpansion( ItemType TheItem, bool bShouldBeExpanded ) override
454 {
456 bool bWasExpanded = false;
457
459 {
460 bWasExpanded = SparseItemInfo->bIsExpanded;
462 }
463 else if(bShouldBeExpanded)
464 {
466 }
467
469 {
471
472 // We must rebuild the linearized version of the tree because
473 // either some children became visible or some got removed.
475 }
476 }
477
478 virtual void Private_OnExpanderArrowShiftClicked( ItemType TheItem, bool bShouldBeExpanded ) override
479 {
480 if(OnSetExpansionRecursive.IsBound())
481 {
483
484 // We must rebuild the linearized version of the tree because
485 // either some children became visible or some got removed.
487 }
488 }
489
490 virtual bool Private_DoesItemHaveChildren( int32 ItemIndexInList ) const override
491 {
492 bool bHasChildren = false;
493
495 {
496 bHasChildren = DenseItemInfos[ItemIndexInList].bHasChildren;
497 }
498 return bHasChildren;
499 }
500
501 virtual int32 Private_GetNestingDepth( int32 ItemIndexInList ) const override
502 {
505 {
506 NestingLevel = DenseItemInfos[ItemIndexInList].GetNestingLevel();
507 }
508 return NestingLevel;
509 }
510
511 virtual const TBitArray<>& Private_GetWiresNeededByDepth(int32 ItemIndexInList) const override
512 {
514 ? DenseItemInfos[ItemIndexInList].NeedsVerticalWire
516 }
517
518 virtual bool Private_IsLastChild(int32 ItemIndexInList) const override
519 {
521 ? DenseItemInfos[ItemIndexInList].bIsLastChild
522 : false;
523 }
524
528 virtual void Private_UpdateParentHighlights()
529 {
531
532 for( typename TItemSet::TConstIterator SelectedItemIt(this->SelectedItems); SelectedItemIt; ++SelectedItemIt )
533 {
534 // Sometimes selection events can come through before the Linearized List is built, so the item may not exist yet.
536 if (ItemIndex == INDEX_NONE)
537 {
538 continue;
539 }
540
541 if(DenseItemInfos.IsValidIndex(ItemIndex))
542 {
543 const FItemInfo& ItemInfo = DenseItemInfos[ItemIndex];
544 int32 ParentIndex = ItemInfo.ParentIndex;
545 while (ParentIndex != INDEX_NONE)
546 {
547 const ItemType& ParentItem = this->LinearizedItems[ParentIndex];
548 this->Private_SetItemHighlighted(ParentItem, true);
549
551 ParentIndex = ParentItemInfo.ParentIndex;
552 }
553 }
554 }
555 }
556
557public:
559 {
561
562 if (bHighlightParentNodesForSelection)
563 {
564 this->Private_UpdateParentHighlights();
565 }
566 }
567
568
569
577 virtual void Tick( const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime ) override
578 {
580
581 if ( bTreeItemsAreDirty )
582 {
583 // Check that ItemsPanel was made; we never make it if the user failed to specify all the parameters necessary to make the tree work.
584 if ( this->ItemsPanel.IsValid() )
585 {
586 // We are about to repopulate linearized items; the ListView that TreeView is built on top of will also need to refresh.
587 bTreeItemsAreDirty = false;
588
589 if ( OnGetChildren.IsBound() && HasValidRootItemsSource() )
590 {
591 // We make copies of the old expansion and selection sets so that we can remove
592 // any items that are no longer seen by the tree.
596
597 // Rebuild the linearized view of the tree data.
600
601 if( !bAllowInvisibleItemSelection &&
602 (this->SelectedItems.Num() != TempSelectedItemsMap.Num() ||
603 this->SelectedItems.Difference(TempSelectedItemsMap).Num() > 0 ||
604 TempSelectedItemsMap.Difference(this->SelectedItems).Num() > 0 ))
605 {
607
609 !this->SelectedItems.Contains( TListTypeTraits<ItemType>::NullableItemTypeConvertToItemType( this->RangeSelectionStart ) ))
610 {
613 }
615 !this->SelectedItems.Contains( TListTypeTraits<ItemType>::NullableItemTypeConvertToItemType( this->SelectorItem ) ) )
616 {
617 this->SelectorItem = this->RangeSelectionStart;
618 }
619
621 }
622
623 // these should come after Private_SignalSelectionChanged(); because through a
624 // series of calls, Private_SignalSelectionChanged() could end up in a child
625 // that indexes into either of these arrays (the index wouldn't be updated yet,
626 // and could be invalid)
627 SparseItemInfos = MoveTemp(TempSparseItemInfo);
629
630 // Once the selection changed events have gone through we can update the parent highlight statuses, which are based on your current selection.
631 if (bHighlightParentNodesForSelection)
632 {
633 this->Private_UpdateParentHighlights();
634 }
635 }
636 }
637 }
638
639 // Tick the TreeView superclass so that it can refresh.
640 // This may be due to TreeView requesting a refresh or because new items became visible due to resizing or scrolling.
642 }
643
668 bool bAddingItems,
669 int32 ParentIndex)
670 {
672
673 NeedsParentWire.Add(false);
675
676 bool bSawExpandedItems = false;
677 for ( int32 ItemIndex = 0; ItemIndex < InItemsSource.Num(); ++ItemIndex )
678 {
679 const ItemType& CurItem = InItemsSource[ItemIndex];
680
681 // Find this items children.
682 TArray<ItemType> ChildItems;
683 {
685 OnGetChildren.Execute(InItemsSource[ItemIndex], ChildItems);
686 }
687
688 const bool bHasChildren = ChildItems.Num() > 0;
689
690 // Child items will need a parent wire at this depth if the item we are inserting now is
691 // not the last item in its immediate parent's list.
692 const bool bIsLastChild = (ItemIndex == InItemsSource.Num() - 1);
693 NeedsParentWire[NestingDepthIndex] = !bIsLastChild;
694
695 // Is this item expanded, does it have expanded children?
697 const bool bIsExpanded = (CurItemInfo == nullptr) ? false : CurItemInfo->bIsExpanded;
698 bool bHasExpandedChildren = (CurItemInfo == nullptr) ? false : CurItemInfo->bHasExpandedChildren;
699
700 // Add this item to the linearized list and update the selection set.
701 if (bAddingItems)
702 {
704
705 NewDenseItemInfos.Add( FItemInfo(NeedsParentWire, bHasChildren, bIsLastChild, ParentIndex) );
706
707 const bool bIsSelected = this->IsItemSelected( CurItem );
708 if (bIsSelected)
709 {
711 }
712 }
713
714 if ( bIsExpanded || bHasExpandedChildren )
715 {
716 // If this item is expanded, we should process all of its children at the next indentation level.
717 // If it is collapsed, process its children but do not add them to the linearized list.
718 const bool bAddChildItems = bAddingItems && bIsExpanded;
720 }
721
722 if ( bIsExpanded || bHasExpandedChildren )
723 {
724 // Update the item info for this tree item.
725 NewSparseItemInfo.Add( CurItem, FSparseItemInfo( bIsExpanded, bHasExpandedChildren) );
726 }
727
728
729 // If we encountered any expanded nodes along the way, the parent has expanded children.
730 bSawExpandedItems = bSawExpandedItems || bIsExpanded || bHasExpandedChildren;
731 }
732
733 return bSawExpandedItems;
734 }
735
737 {
738 // The value we return, to signify if we want the hierarchy to be collapsed even if it doesn't reach the max amount
740
741 if (InItemsSource.IsEmpty())
742 {
744 }
745
746 // Calculate the index of the first item in view
747 int32 StartIndex = FMath::Clamp((int32)(FMath::FloorToDouble(Results.NewScrollOffset)), 0, InItemsSource.Num() - 1);
748 int32 CurrentItemIndex = StartIndex;
749
750 auto GetNonVisibleParents = [this, &InItemsSource, StartIndex](TArray<ItemType>& OutParents, int32 ItemIndex) {
751 if (!DenseItemInfos.IsValidIndex(ItemIndex))
752 {
753 return;
754 }
755
756 int32 ParentIndex = ItemIndex;
757
758 // Walk through the list of parents of the current item until you reach the root
759 do
760 {
761 ParentIndex = DenseItemInfos[ItemIndex].ParentIndex;
762
763 // If the current item has a parent, and the parent is not visible, add the parent to the list of pinned items
764 if (InItemsSource.IsValidIndex(ParentIndex) && ParentIndex < StartIndex)
765 {
766 OutParents.Add(InItemsSource[ParentIndex]);
767 }
768
769 ItemIndex = ParentIndex;
770
771 } while (ParentIndex != INDEX_NONE);
772 };
773
774 /* Special Case for if we are at the end of the list. When there is no space to scroll down in a list, changing the pinned hierarchy could also change the first visible item
775 * which is used to calculate the pinned hierarchy. This leads to an infinite loop, so we solve this by finding a first visible item that has a hierachy large enough to hide
776 * itself, and then collapse the hierarchy until the item remains the first visible item (so there are no infinite loops since the first visible item doesn't change)
777 *
778 */
779 if (Results.bGeneratedPastLastItem && Results.NewScrollOffset > 0)
780 {
781 int32 LastItem = InItemsSource.Num() - 1;
783
784 // Could be different than reported by STableViewBase if some items are collapsed
786
787 // This is the first item that would be visible, if there were no pinned rows
788 int32 FirstItem = FMath::TruncToInt32(Results.NewScrollOffset - NumPinnedItems);
789
790 // We find items that have a hierarchy big enough to cover themselves, but select the smallest among them
792
793 // The index of the item we select
794 int32 MinIndex = -1;
795
796 for (int32 ItemIndex = FirstItem; ItemIndex <= LastItem; ItemIndex++)
797 {
798 // Get all parents of the current item that are not visible, to calculate the number of items in its hierarchy
801
803
804 // How many items would be required in the hierarchy to cover the item itself
805 int32 IndexOffset = ItemIndex - FirstItem;
806
807 // If the hierarchy is too small, ignore it
808 if (NumParents < IndexOffset)
809 {
810 continue;
811 }
812
813 // If hierarchy is the smallest we have found so far, AND the number of pinned items it will require is < the allowed max
814 if (NumParents - IndexOffset < MinSpaceOccupied && IndexOffset <= CurrentMaxPinnedItems)
815 {
816 MinSpaceOccupied = NumParents - IndexOffset;
817 MinIndex = ItemIndex;
818 }
819
820 }
821
822 // If we found no such items, we are in the middle of generating the list so pinned rows are not required
823 if (MinIndex == -1)
824 {
826 }
827
828 CurrentItemIndex = MinIndex;
829 MaxPinnedItemsOverride = MinIndex - FirstItem;
830 }
831
832 // Get all the parents of the item that are not visible, which is the hierarchy to stack
833 GetNonVisibleParents(InPinnedItems, CurrentItemIndex);
834
835 // Reverse the list so the root is at the front
837
839 }
840
847 virtual TSharedRef<ITableRow> GenerateNewWidget( ItemType InItem ) override
848 {
849 if ( this->OnGenerateRow.IsBound() )
850 {
851 return this->OnGenerateRow.Execute( InItem, this->SharedThis(this) );
852 }
853 else
854 {
856
857 // The programmer did not provide an OnGenerateRow() handler; let them know.
860 .Content()
861 [
862 SNew(STextBlock) .Text( NSLOCTEXT("STreeView", "BrokenSetupMessage", "OnGenerateWidget() not assigned.") )
863 ];
864
865 return NewTreeItemWidget;
866 }
867 }
868
870 virtual void RequestListRefresh() override
871 {
872 if (!bTreeItemsAreDirty)
873 {
874 bTreeItemsAreDirty = true;
876 }
877 }
878
880 {
882 }
883
884 virtual void RebuildList() override
885 {
888 }
889
895
902 void SetItemExpansion( const ItemType& InItem, bool InShouldExpandItem )
903 {
904 Private_SetItemExpansion(InItem, InShouldExpandItem);
905 }
906
908 void SetSingleExpandedItem( const ItemType& InItem )
909 {
910 // Will we have to do any work?
911 const bool bItemAlreadyLoneExpanded = (this->SparseItemInfos.Num() == 1) && this->IsItemExpanded(InItem);
912
914 {
915 this->SparseItemInfos.Empty();
916 Private_SetItemExpansion(InItem, true);
917 }
918 }
919
925 bool IsItemExpanded( const ItemType& InItem ) const
926 {
927 return Private_IsItemExpanded( InItem );
928 }
929
930public:
931 //~ Hide the base function from SListView
932 UE_DEPRECATED(5.3, "SetItemsSource is deprecated. You probably want to use SetTreeItemsSource.")
937 UE_DEPRECATED(5.3, "SetItemsSource is deprecated. You probably want to use SetTreeItemsSource.")
938 void SetItemsSource(TSharedRef<::UE::Slate::Containers::TObservableArray<ItemType>> InListItemsSource)
939 {
941 }
942 UE_DEPRECATED(5.3, "SetItemsSource is deprecated. You probably want to use SetTreeItemsSource.")
943 void SetItemsSource(TUniquePtr<UE::Slate::ItemsSource::IItemsSource<ItemType>> Provider)
944 {
946 }
947 UE_DEPRECATED(5.3, "ClearItemsSource is deprecated. You probably want to use ClearRootItemsSource.")
952 UE_DEPRECATED(5.3, "HasValidItemsSource is deprecated. You probably want to use HasValidRootItemsSource.")
957 UE_DEPRECATED(5.3, "GetItems is deprecated. You probably want to use GetRootItems.")
958 TArrayView<const ItemType> GetItems() const
959 {
961 }
962
963public:
964
973
979 {
980 ensureMsgf(InItemsSource, TEXT("The TreeItemsSource is invalid."));
981 if (TreeViewSource == nullptr || !TreeViewSource->IsSame(reinterpret_cast<const void*>(InItemsSource)))
982 {
983 if (InItemsSource)
984 {
986 }
987 else
988 {
990 }
991 }
992 }
993
999 {
1000 if (TreeViewSource == nullptr || !TreeViewSource->IsSame(reinterpret_cast<const void*>(&InItemsSource.Get())))
1001 {
1003 }
1004 }
1005
1011 {
1012 TreeViewSource = MoveTemp(Provider);
1014 }
1015
1020
1022 {
1023 return TreeViewSource != nullptr;
1024 }
1025
1027 {
1028 return TreeViewSource ? TreeViewSource->GetItems() : TArrayView<const ItemType>();
1029 }
1030
1037 {
1038 for( typename TSparseItemMap::TConstIterator InfoIterator(SparseItemInfos); InfoIterator; ++InfoIterator )
1039 {
1040 if ( InfoIterator.Value().bIsExpanded )
1041 {
1042 ExpandedItems.Add( InfoIterator.Key() );
1043 }
1044 }
1045 }
1046
1049 {
1050 SparseItemInfos.Empty();
1052 }
1053
1055 {
1056 // We need to call the parent function first to know if we reached the end of the list
1058
1059 if (bShouldStackHierarchyHeaders.Get())
1060 {
1062
1063 // If we reached the end of the list and there is space, a special case requires the hierarchy to be collapsed forcefully
1066 }
1067 else
1068 {
1069 this->ClearPinnedWidgets();
1070 }
1071
1072 return Results;
1073 }
1074
1075protected:
1076
1079
1082
1083 UE_DEPRECATED(5.3, "Protected access to TreeItemsSource is deprecated. Please use GetTreeItems, SetTreeItemsSource or HasValidTreeItemsSource.")
1085 const TArray<ItemType>* TreeItemsSource;
1086
1089
1092
1098
1101
1104
1105private:
1107 TUniquePtr<UE::Slate::ItemsSource::IItemsSource<ItemType>> TreeViewSource;
1108
1110 bool bTreeItemsAreDirty = false;
1111
1113 bool bAllowInvisibleItemSelection = false;
1114
1116 bool bHighlightParentNodesForSelection = false;
1117
1119 TAttribute<bool> bShouldStackHierarchyHeaders = false;
1120};
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define ensureMsgf( InExpression, InFormat,...)
Definition AssertionMacros.h:465
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
TSharedRef< InObjectType, InMode > MakeShared(InArgTypes &&... Args)
Definition SharedPointer.h:2009
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define TRACE_CPUPROFILER_EVENT_SCOPE(Name)
Definition CpuProfilerTrace.h:528
#define SLATE_STYLE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:280
#define SNew(WidgetType,...)
Definition DeclarativeSyntaxSupport.h:37
#define SLATE_ATTRIBUTE(AttrType, AttrName)
Definition DeclarativeSyntaxSupport.h:192
#define SLATE_ATTRIBUTE_DEPRECATED(AttrType, AttrName, DeprecationVersion, DeprecationMessage)
Definition DeclarativeSyntaxSupport.h:199
#define SLATE_EVENT(DelegateName, EventName)
Definition DeclarativeSyntaxSupport.h:458
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
#define SLATE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:208
EFocusCause
Definition Events.h:25
return true
Definition ExternalRpcRegistry.cpp:601
#define SLATE_ITEMS_SOURCE_ARGUMENT(ArgType, ArgName)
Definition IItemsSource.h:20
#define NSLOCTEXT(InNamespace, InKey, InTextLiteral)
Definition Internationalization.h:300
const bool
Definition NetworkReplayStreaming.h:178
EAllowOverscroll
Definition Overscroll.h:12
float GetGlobalScrollAmount()
Definition SlateConstants.h:10
EConsumeMouseWheel
Definition SlateTypes.h:26
UE_FORCEINLINE_HINT TUniquePtr< T > MakeUnique(TArgs &&... Args)
Definition UniquePtr.h:918
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition AppStyle.h:24
bool IsEventHandled() const
Definition ReplyBase.h:19
Definition Reply.h:24
static FReply Handled()
Definition Reply.h:233
static SLATECORE_API const FSlateBrush * GetNoBrush()
Definition StyleDefaults.cpp:6
static CORE_API FText FromString(const ANSICHAR *String)
Definition Text.cpp:1081
FCompoundWidgetOneChildSlot ChildSlot
Definition SCompoundWidget.h:113
Definition SHeaderRow.h:103
Definition SListView.h:66
void SetShadowBoxStyle(const FScrollBoxStyle *InScrollBoxStyle)
Definition SListView.h:1334
bool IsItemSelected(const ItemType &InItem) const
Definition SListView.h:1819
bool HasValidItemsSource() const
Definition SListView.h:1790
TAttribute< int32 > DefaultMaxPinnedItems
Definition SListView.h:2742
TArrayView< const ItemType > GetItems() const
Definition SListView.h:1795
FOnGenerateRow OnGeneratePinnedRow
Definition SListView.h:2642
FOnKeyDown OnKeyDownHandler
Definition SListView.h:2703
FOnRefreshRow OnRefreshRow
Definition SListView.h:2645
virtual void Private_SignalSelectionChanged(ESelectInfo::Type SelectInfo) override
Definition SListView.h:1025
void ReGeneratePinnedItems(const TArray< ItemType > &InItems, const FGeometry &MyGeometry, int32 MaxPinnedItemsOverride=-1)
Definition SListView.h:1583
virtual void Private_ClearHighlightedItems() override
Definition SListView.h:1112
FOnItemToString_Debug OnItemToString_Debug
Definition SListView.h:2648
NullableItemType RangeSelectionStart
Definition SListView.h:2669
FIsSelectableOrNavigable OnIsSelectableOrNavigable
Definition SListView.h:2694
static FOnItemToString_Debug GetDefaultDebugDelegate()
Definition SListView.h:2145
FOnWidgetToBeRemoved OnRowReleased
Definition SListView.h:2654
FOnItemScrolledIntoView OnItemScrolledIntoView
Definition SListView.h:2657
NullableItemType SelectorItem
Definition SListView.h:2666
FOnMouseButtonClick OnClick
Definition SListView.h:2697
FOnMouseButtonDoubleClick OnDoubleClick
Definition SListView.h:2700
FOnTableViewBadState OnEnteredBadState
Definition SListView.h:2651
bool bHandleDirectionalNavigation
Definition SListView.h:2718
const TArray< ItemType > * ItemsSource
Definition SListView.h:2676
void SetItemsSource(const TArray< ItemType > *InListItemsSource)
Definition SListView.h:1721
virtual void Private_SetItemHighlighted(ItemType TheItem, bool bShouldBeHighlighted) override
Definition SListView.h:1100
FOnGenerateRow OnGenerateRow
Definition SListView.h:2639
TItemSet SelectedItems
Definition SListView.h:2663
FOnFinishedScrolling OnFinishedScrolling
Definition SListView.h:2660
FReply OnKeyDown_Internal(const FGeometry &MyGeometry, const FKeyEvent &InKeyEvent)
Definition SListView.h:370
virtual void RebuildList() override
Definition SListView.h:1921
bool bReturnFocusToSelection
Definition SListView.h:2724
void ClearItemsSource()
Definition SListView.h:1772
FOnSelectionChanged OnSelectionChanged
Definition SListView.h:2691
virtual void NavigationSelect(const ItemType &InItemToSelect, const FInputEvent &InInputEvent)
Definition SListView.h:2566
bool bHandleGamepadEvents
Definition SListView.h:2715
TAttribute< int32 > MaxPinnedItems
Definition SListView.h:2739
virtual FReGenerateResults ReGenerateItems(const FGeometry &MyGeometry) override
Definition SListView.h:1395
bool bClearSelectionOnClick
Definition SListView.h:2712
Definition SScrollBar.h:29
SLATE_API void SetDragFocusCause(EFocusCause InDragFocusCause)
Definition SScrollBar.cpp:394
Definition STableRow.h:87
TAttribute< ESelectionMode::Type > SelectionMode
Definition STableViewBase.h:526
const FScrollBoxStyle * ShadowBoxStyle
Definition STableViewBase.h:559
SLATE_API int32 GetNumPinnedItems() const
Definition STableViewBase.cpp:1390
TSharedPtr< SHeaderRow > HeaderRow
Definition STableViewBase.h:529
bool bShouldUseShadowBoxStyle
Definition STableViewBase.h:556
float WheelScrollMultiplier
Definition STableViewBase.h:541
FSimpleDelegate OnItemsRebuilt
Definition STableViewBase.h:523
virtual SLATE_API void RequestListRefresh()
Definition STableViewBase.cpp:837
EAllowOverscroll AllowOverscroll
Definition STableViewBase.h:589
TSharedPtr< SListPanel > ItemsPanel
Definition STableViewBase.h:437
virtual SLATE_API void Tick(const FGeometry &AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override
Definition STableViewBase.cpp:364
SLATE_API void ClearPinnedWidgets()
Definition STableViewBase.cpp:1209
FOnContextMenuOpening OnContextMenuOpening
Definition STableViewBase.h:520
virtual SLATE_API FReply OnMouseButtonDoubleClick(const FGeometry &InMyGeometry, const FPointerEvent &InMouseEvent) override
Definition STableViewBase.cpp:555
TSharedPtr< SScrollBar > ScrollBar
Definition STableViewBase.h:443
SLATE_API void SetBackgroundBrush(const TAttribute< const FSlateBrush * > &InBackgroundBrush)
Definition STableViewBase.cpp:1160
EConsumeMouseWheel ConsumeMouseWheel
Definition STableViewBase.h:592
bool bEnableAnimatedScrolling
Definition STableViewBase.h:471
SLATE_API void ConstructChildren(const TAttribute< float > &InItemWidth, const TAttribute< float > &InItemHeight, const TAttribute< EListItemAlignment > &InItemAlignment, const TSharedPtr< SHeaderRow > &InHeaderRow, const TSharedPtr< SScrollBar > &InScrollBar, EOrientation InScrollOrientation, const FOnTableViewScrolled &InOnTableViewScrolled, const FScrollBarStyle *InScrollBarStyle=nullptr, const bool bInPreventThrottling=false)
Definition STableViewBase.cpp:130
TOptional< double > FixedLineScrollOffset
Definition STableViewBase.h:468
Definition STextBlock.h:45
Definition STreeView.h:90
bool HasValidItemsSource() const
Definition STreeView.h:953
virtual void Private_SignalSelectionChanged(ESelectInfo::Type SelectInfo) override
Definition STreeView.h:558
TArrayView< const ItemType > GetItems() const
Definition STreeView.h:958
void SetRootItemsSource(const TArray< ItemType > *InItemsSource)
Definition STreeView.h:978
typename TListTypeTraits< ItemType >::MapKeyFuncsSparse MapKeyFuncsSparse
Definition STreeView.h:95
typename SListView< ItemType >::FOnWidgetToBeRemoved FOnWidgetToBeRemoved
Definition STreeView.h:113
int32 PopulatePinnedItems(const TArray< ItemType > &InItemsSource, TArray< ItemType > &InPinnedItems, const STableViewBase::FReGenerateResults &Results)
Definition STreeView.h:736
typename TListTypeTraits< ItemType >::NullableType NullableItemType
Definition STreeView.h:93
void SetItemsSource(const TArray< ItemType > *InListItemsSource)
Definition STreeView.h:933
typename TSlateDelegates< ItemType >::FOnGenerateRow FOnGenerateRow
Definition STreeView.h:101
bool IsItemExpanded(const ItemType &InItem) const
Definition STreeView.h:925
SLATE_BEGIN_ARGS(STreeView< ItemType >)
Definition STreeView.h:117
virtual STableViewBase::FReGenerateResults ReGenerateItems(const FGeometry &MyGeometry) override
Definition STreeView.h:1054
void SetItemExpansion(const ItemType &InItem, bool InShouldExpandItem)
Definition STreeView.h:902
FOnExpansionChanged OnExpansionChanged
Definition STreeView.h:1100
TSet< TObjectPtrWrapTypeOf< ItemType >, typename TListTypeTraits< TObjectPtrWrapTypeOf< ItemType > >::SetKeyFuncs > TItemSet
Definition STreeView.h:98
void SetSingleExpandedItem(const ItemType &InItem)
Definition STreeView.h:908
STreeView()
Definition STreeView.h:351
FOnGetChildren OnGetChildren
Definition STreeView.h:1078
virtual void Tick(const FGeometry &AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override
Definition STreeView.h:577
typename TSlateDelegates< ItemType >::FOnItemScrolledIntoView FOnItemScrolledIntoView
Definition STreeView.h:104
const TArray< ItemType > * TreeItemsSource
Definition STreeView.h:1085
typename TSlateDelegates< ItemType >::FIsSelectableOrNavigable FIsSelectableOrNavigable
Definition STreeView.h:106
void SetStyle(const FTableViewStyle *InStyle)
Definition STreeView.h:890
typename TSlateDelegates< ItemType >::FOnItemToString_Debug FOnItemToString_Debug
Definition STreeView.h:111
bool PopulateLinearizedItems(TArrayView< const ItemType > InItemsSource, TArray< ItemType > &InLinearizedItems, TArray< FItemInfo > &NewDenseItemInfos, TBitArray<> NeedsParentWire, TItemSet &OutNewSelectedItems, TSparseItemMap &NewSparseItemInfo, bool bAddingItems, int32 ParentIndex)
Definition STreeView.h:661
TArray< ItemType > LinearizedItems
Definition STreeView.h:1097
void GetExpandedItems(TItemSet &ExpandedItems) const
Definition STreeView.h:1036
typename TSlateDelegates< ItemType >::FOnGetChildren FOnGetChildren
Definition STreeView.h:100
void ClearRootItemsSource()
Definition STreeView.h:1016
typename TSlateDelegates< ItemType >::FOnSetExpansionRecursive FOnSetExpansionRecursive
Definition STreeView.h:103
virtual FReply OnKeyDown(const FGeometry &MyGeometry, const FKeyEvent &InKeyEvent) override
Definition STreeView.h:362
virtual TSharedRef< ITableRow > GenerateNewWidget(ItemType InItem) override
Definition STreeView.h:847
virtual void RebuildList() override
Definition STreeView.h:884
void SetRootItemsSource(TUniquePtr< UE::Slate::ItemsSource::IItemsSource< ItemType > > Provider)
Definition STreeView.h:1010
typename TSlateDelegates< NullableItemType >::FOnSelectionChanged FOnSelectionChanged
Definition STreeView.h:105
bool HasValidRootItemsSource() const
Definition STreeView.h:1021
void SetRootItemsSource(TSharedRef< UE::Slate::Containers::TObservableArray< ItemType > > InItemsSource)
Definition STreeView.h:998
TArray< FItemInfo > DenseItemInfos
Definition STreeView.h:1091
TSparseItemMap SparseItemInfos
Definition STreeView.h:1088
typename TSlateDelegates< ItemType >::FOnExpansionChanged FOnExpansionChanged
Definition STreeView.h:109
typename TListTypeTraits< ItemType >::MapKeyFuncs MapKeyFuncs
Definition STreeView.h:94
typename TSlateDelegates< ItemType >::FOnRefreshRow FOnRefreshRow
Definition STreeView.h:102
void SetTreeItemsSource(const TArray< ItemType > *InItemsSource)
Definition STreeView.h:969
TArrayView< const ItemType > GetRootItems() const
Definition STreeView.h:1026
FOnSetExpansionRecursive OnSetExpansionRecursive
Definition STreeView.h:1081
void RequestTreeRefresh()
Definition STreeView.h:879
void ClearItemsSource()
Definition STreeView.h:948
typename TSlateDelegates< ItemType >::FOnMouseButtonClick FOnMouseButtonClick
Definition STreeView.h:107
void ClearExpandedItems()
Definition STreeView.h:1048
const FTableViewStyle * Style
Definition STreeView.h:1103
void Construct(const FArguments &InArgs)
Definition STreeView.h:253
typename TSlateDelegates< ItemType >::FOnMouseButtonDoubleClick FOnMouseButtonDoubleClick
Definition STreeView.h:108
virtual void RequestListRefresh() override
Definition STreeView.h:870
EWidgetClipping Clipping
Definition SWidget.h:1827
void AddMetadata(const TSharedRef< MetaDataType > &AddMe)
Definition SWidget.h:1383
MixedIntoType & HAlign(EHorizontalAlignment InHAlignment)
Definition BasicLayoutWidgetSlot.h:149
Definition ArrayView.h:139
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
UE_NODEBUG UE_FORCEINLINE_HINT bool IsValidIndex(SizeType Index) const
Definition Array.h:1122
UE_NODEBUG UE_FORCEINLINE_HINT bool Find(const ElementType &Item, SizeType &Index) const
Definition Array.h:1302
void Empty(SizeType Slack=0)
Definition Array.h:2273
Definition Attribute.h:17
const ObjectType & Get() const
Definition Attribute.h:241
UE_FORCEINLINE_HINT int32 Num() const
Definition BitArray.h:1466
TSharedRef< SWidget, Mode > AsShared()
Definition SharedPointer.h:1650
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis(OtherType *ThisPtr)
Definition SharedPointer.h:1780
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT const bool IsValid() const
Definition SharedPointer.h:1085
Definition SharedPointer.h:153
Definition SlateDelegates.h:134
Definition TableViewMetadata.h:20
Definition UniquePtr.h:107
Definition IItemsSource.h:106
Definition IItemsSource.h:91
UE_REWRITE void Reverse(T(&Array)[ArraySize])
Definition Reverse.h:28
Type
Definition SlateEnums.h:311
@ Direct
Definition SlateEnums.h:319
Definition ITypedTableView.h:14
Definition ITypedTableView.h:35
const FName ParentIndex("ParentIndex")
Definition SkeletalMeshAttributes.h:33
Definition SScissorRectBox.cpp:10
SLATE_API const TBitArray & GetEmptyBitArray()
Definition STableViewBase.cpp:1402
Definition AdvancedWidgetsModule.cpp:13
@ false
Definition radaudio_common.h:23
static INPUTCORE_API const FKey Left
Definition InputCoreTypes.h:319
static INPUTCORE_API const FKey Right
Definition InputCoreTypes.h:321
Definition Geometry.h:40
bool IsAltDown() const
Definition Events.h:268
Definition STreeView.h:45
int32 GetNestingLevel() const
Definition STreeView.h:65
TBitArray NeedsVerticalWire
Definition STreeView.h:63
uint32 bHasChildren
Definition STreeView.h:68
FItemInfo(TBitArray<> InNeedsVerticalWire, bool InHasChildren, bool InIsLastChild, int32 InParentIndex)
Definition STreeView.h:50
uint32 bIsLastChild
Definition STreeView.h:71
int32 ParentIndex
Definition STreeView.h:74
FItemInfo()
Definition STreeView.h:46
Definition Events.h:431
static constexpr UE_FORCEINLINE_HINT T Clamp(const T X, const T MinValue, const T MaxValue)
Definition UnrealMathUtility.h:592
Definition SlateTypes.h:932
Definition SlateTypes.h:2023
Definition STreeView.h:22
FSparseItemInfo(bool InIsExpanded, bool InHasExpandedChildren)
Definition STreeView.h:29
bool bIsExpanded
Definition STreeView.h:36
bool bHasExpandedChildren
Definition STreeView.h:39
Definition SlateTypes.h:1606
FSlateBrush BackgroundBrush
Definition SlateTypes.h:1622
Definition STableViewBase.h:365
double NewScrollOffset
Definition STableViewBase.h:374
bool bGeneratedPastLastItem
Definition STableViewBase.h:383
Definition TableViewTypeTraits.h:121
Definition NumericLimits.h:41
Definition Optional.h:131
Definition ObservableArray.h:187