UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Children.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"
7#include "SlotBase.h"
10#include "Widgets/SWidget.h"
11
12
18class FCombinedChildren final : public FChildren
19{
20public:
22
27
29 virtual int32 Num() const override
30 {
31 int32 TotalNum = 0;
32 for (const FChildren* Children : LinkedChildren)
33 {
34 TotalNum += Children->Num();
35 }
36
37 return TotalNum;
38 }
39
41 {
42 int32 TotalNum = 0;
43 for (FChildren* Children : LinkedChildren)
44 {
45 const int32 NewTotal = TotalNum + Children->Num();
46 if (NewTotal > Index)
47 {
48 return Children->GetChildAt(Index - TotalNum);
49 }
50 TotalNum = NewTotal;
51 }
52 // This result should never occur users should always access a valid index for child slots.
53 check(false);
55 }
56
58 {
59 int32 TotalNum = 0;
60 for (const FChildren* Children : LinkedChildren)
61 {
62 const int32 NewTotal = TotalNum + Children->Num();
63 if (NewTotal > Index)
64 {
65 return Children->GetChildAt(Index - TotalNum);
66 }
67 TotalNum = NewTotal;
68 }
69 // This result should never occur users should always access a valid index for child slots.
70 check(false);
72 }
73
74protected:
75 virtual int32 NumSlot() const override
76 {
77 int32 TotalNum = 0;
78 for (const FChildren* Children : LinkedChildren)
79 {
80 TotalNum += Children->NumSlot();
81 }
82
83 return TotalNum;
84 }
85
86 virtual const FSlotBase& GetSlotAt(int32 ChildIndex) const override
87 {
88 int32 TotalNum = 0;
89 for (const FChildren* Children : LinkedChildren)
90 {
91 const int32 NewTotal = TotalNum + Children->NumSlot();
92 if (NewTotal > ChildIndex)
93 {
94 return Children->GetSlotAt(ChildIndex - TotalNum);
95 }
96 TotalNum = NewTotal;
97 }
98
99 // This result should never occur users should always access a valid index for child slots.
100 check(false);
101 static FSlotBase NullSlot;
102 return NullSlot;
103 }
104
106 {
107 int32 TotalNum = 0;
108 for (FChildren* Children : LinkedChildren)
109 {
110 const int32 NewTotal = TotalNum + Children->Num();
111 if (NewTotal > Index)
112 {
113 return Children->GetChildRefAt(Index - TotalNum);
114 }
115 TotalNum = NewTotal;
116 }
117 // This result should never occur users should always access a valid index for child slots.
118 check(false);
120 }
121
122 virtual FConstWidgetRef GetChildRefAt(int32 Index) const override
123 {
124 int32 TotalNum = 0;
125 for (const FChildren* Children : LinkedChildren)
126 {
127 const int32 NewTotal = TotalNum + Children->Num();
128 if (NewTotal > Index)
129 {
130 return Children->GetChildRefAt(Index - TotalNum);
131 }
132 TotalNum = NewTotal;
133 }
134 // This result should never occur users should always access a valid index for child slots.
135 check(false);
137 }
138
139protected:
141};
142
143
148class FNoChildren final : public FChildren
149{
150public:
152
153public:
158
160 : FChildren(InOwner, InName)
161 {
162 }
163
164 virtual int32 Num() const override { return 0; }
165
167 {
168 // Nobody should be getting a child when there aren't any children.
169 // We expect this to crash!
170 check( false );
172 }
173
175 {
176 // Nobody should be getting a child when there aren't any children.
177 // We expect this to crash!
178 check( false );
180 }
181
182private:
183 friend class SWidget;
184 virtual const FSlotBase& GetSlotAt(int32 ChildIndex) const override
185 {
186 check(false);
187 static FSlotBase NullSlot;
188 return NullSlot;
189 }
190
191 virtual FWidgetRef GetChildRefAt(int32 Index) override
192 {
193 check(false);
194 return FWidgetRef(ReferenceConstruct, SNullWidget::NullWidget.Get());
195 }
196
197 virtual FConstWidgetRef GetChildRefAt(int32 Index) const override
198 {
199 check(false);
200 return FConstWidgetRef(ReferenceConstruct, SNullWidget::NullWidget.Get());
201 }
202};
203
204
210template <typename ChildType>
211class TWeakChild final : public FChildren
212{
213public:
215
216 virtual int32 Num() const override
217 {
218 return WidgetPtr.IsValid() ? 1 : 0 ;
219 }
220
221 virtual TSharedRef<SWidget> GetChildAt( int32 ChildIndex ) override
222 {
223 check(ChildIndex == 0);
224 return GetWidget();
225 }
226
227 virtual TSharedRef<const SWidget> GetChildAt( int32 ChildIndex ) const override
228 {
229 check(ChildIndex == 0);
230 return GetWidget();
231 }
232
233private:
234 virtual int32 NumSlot() const override
235 {
236 return 0;
237 }
238
239 virtual const FSlotBase& GetSlotAt(int32 ChildIndex) const override
240 {
241 static FSlotBase NullSlot;
242 check(ChildIndex == 0);
243 return NullSlot;
244 }
245
246 virtual FWidgetRef GetChildRefAt(int32 ChildIndex) override
247 {
248 check(ChildIndex == 0);
249 TSharedPtr<SWidget> Widget = WidgetPtr.Pin();
250 return (Widget.IsValid()) ? FWidgetRef(CopyConstruct, Widget.ToSharedRef()) : FWidgetRef(ReferenceConstruct, SNullWidget::NullWidget.Get());
251 }
252 virtual FConstWidgetRef GetChildRefAt(int32 ChildIndex) const override
253 {
254 check(ChildIndex == 0);
255 TSharedPtr<SWidget> Widget = WidgetPtr.Pin();
256 return (Widget.IsValid()) ? FConstWidgetRef(CopyConstruct, Widget.ToSharedRef()) : FConstWidgetRef(ReferenceConstruct, SNullWidget::NullWidget.Get());
257 }
258
259public:
261 {
262 if (WidgetPtr != InWidget)
263 {
264 WidgetPtr = InWidget;
266
267 if (InWidget.IsValid() && InWidget != SNullWidget::NullWidget)
268 {
269 InWidget->AssignParentWidget(GetOwner().AsShared());
270 }
271 }
272 }
273
275 {
276 if (TSharedPtr<SWidget> Widget = WidgetPtr.Pin())
277 {
279 {
280 Widget->ConditionallyDetatchParentWidget(&GetOwner());
281 }
282
283 WidgetPtr.Reset();
284 }
285 }
286
288 {
289 ensure(Num() > 0);
290 TSharedPtr<SWidget> Widget = WidgetPtr.Pin();
291 return (Widget.IsValid()) ? Widget.ToSharedRef() : SNullWidget::NullWidget;
292 }
293
294private:
295 TWeakPtr<ChildType> WidgetPtr;
296};
297
298
300template<typename SlotType>
301class TSingleWidgetChildrenWithSlot : public FChildren, protected TSlotBase<SlotType>
302{
303public:
306 , TSlotBase<SlotType>(static_cast<const FChildren&>(*this))
307 {
308 }
309
311 : FChildren(InOwner, InName)
312 , TSlotBase<SlotType>(static_cast<const FChildren&>(*this))
313 {
314 }
315
316 TSingleWidgetChildrenWithSlot(std::nullptr_t) = delete;
317
318public:
319 virtual int32 Num() const override { return 1; }
320
321 virtual TSharedRef<SWidget> GetChildAt(int32 ChildIndex) override
322 {
323 check(ChildIndex == 0);
324 return this->GetWidget();
325 }
326
327 virtual TSharedRef<const SWidget> GetChildAt(int32 ChildIndex) const override
328 {
329 check(ChildIndex == 0);
330 return this->GetWidget();
331 }
332
333public:
334 struct FSlotArguments : protected TSlotBase<SlotType>::FSlotArguments
335 {
340
342
343 typename SlotType::FSlotArguments& operator[](const TSharedRef<SWidget>& InChildWidget)
344 {
346 return static_cast<typename SlotType::FSlotArguments&>(*this);
347 }
348 };
349
351 {
353 }
354
355public:
356 TSlotBase<SlotType>& AsSlot() { return *this; }
357 const TSlotBase<SlotType>& AsSlot() const { return *this; }
358
359 using TSlotBase<SlotType>::GetOwnerWidget;
360 using TSlotBase<SlotType>::AttachWidget;
361 using TSlotBase<SlotType>::DetachWidget;
362 using TSlotBase<SlotType>::GetWidget;
363 using TSlotBase<SlotType>::Invalidate;
365 {
366 this->AttachWidget(InChildWidget);
367 return static_cast<SlotType&>(*this);
368 }
369
370 SlotType& Expose(SlotType*& OutVarToInit)
371 {
372 OutVarToInit = static_cast<SlotType*>(this);
373 return static_cast<SlotType&>(*this);
374 }
375
376private:
377 virtual const FSlotBase& GetSlotAt(int32 ChildIndex) const override
378 {
379 check(ChildIndex == 0);
380 return *this;
381 }
382
383 virtual FWidgetRef GetChildRefAt(int32 ChildIndex) override
384 {
385 check(ChildIndex == 0);
386 return FWidgetRef(ReferenceConstruct, this->GetWidget().Get());
387 }
388 virtual FConstWidgetRef GetChildRefAt(int32 ChildIndex) const override
389 {
390 check(ChildIndex == 0);
391 return FConstWidgetRef(ReferenceConstruct, this->GetWidget().Get());
392 }
393};
394
395
402
403
405template<EInvalidateWidgetReason InPaddingInvalidationReason = EInvalidateWidgetReason::Layout>
406class TSingleWidgetChildrenWithBasicLayoutSlot : public TSingleWidgetChildrenWithSlot<TSingleWidgetChildrenWithBasicLayoutSlot<InPaddingInvalidationReason>>
407 , public TPaddingSingleWidgetSlotMixin<TSingleWidgetChildrenWithBasicLayoutSlot<InPaddingInvalidationReason>, InPaddingInvalidationReason>
408 , public TAlignmentSingleWidgetSlotMixin<TSingleWidgetChildrenWithBasicLayoutSlot<InPaddingInvalidationReason>>
409{
410private:
414
415public:
423
431
434
435public:
445};
446
447
452
453
459template<typename SlotType>
460class TPanelChildren final : public FChildren
461{
462private:
464 static constexpr bool bSupportSlotWithSlateAttribute = std::is_base_of<TWidgetSlotWithAttributeSupport<SlotType>, SlotType>::value;
465
466protected:
467 virtual const FSlotBase& GetSlotAt(int32 ChildIndex) const override
468 {
469 return *Children[ChildIndex];
470 }
471
472 virtual FWidgetRef GetChildRefAt(int32 ChildIndex) override
473 {
474 return FWidgetRef(ReferenceConstruct, Children[ChildIndex]->GetWidget().Get());
475 }
476
477 virtual FConstWidgetRef GetChildRefAt(int32 ChildIndex) const override
478 {
479 return FConstWidgetRef(ReferenceConstruct, Children[ChildIndex]->GetWidget().Get());
480 }
481
482public:
484
485 virtual int32 Num() const override
486 {
487 return Children.Num();
488 }
489
491 {
492 return Children[Index]->GetWidget();
493 }
494
496 {
497 return Children[Index]->GetWidget();
498 }
499
500 virtual bool SupportSlotWithSlateAttribute() const override
501 {
502 return bSupportSlotWithSlateAttribute;
503 }
504
505public:
506 int32 AddSlot(typename SlotType::FSlotArguments&& SlotArgument)
507 {
509 check(NewSlot.Get());
510 int32 Result = Children.Add(MoveTemp(NewSlot));
511 Children[Result]->Construct(*this, MoveTemp(SlotArgument));
512 return Result;
513 }
514
516 {
517 Children.Reserve(Children.Num() + SlotArguments.Num());
518 for (typename SlotType::FSlotArguments& Arg : SlotArguments)
519 {
520 AddSlot(MoveTemp(Arg));
521 }
522 }
523
525 {
526 // NOTE:
527 // We don't do any invalidating here, that's handled by the FSlotBase, which eventually calls ConditionallyDetatchParentWidget
528
529 // Steal the instance from the array, then free the element.
530 // This alleviates issues where (misbehaving) destructors on the children may call back into this class and query children while they are being destroyed.
532 Children.RemoveAt(Index);
533 SlotToRemove.Reset();
534 }
535
538 {
539 for (int32 SlotIdx = 0; SlotIdx < Num(); ++SlotIdx)
540 {
541 if (SlotWidget == Children[SlotIdx]->GetWidget())
542 {
543 Children.RemoveAt(SlotIdx);
544 return SlotIdx;
545 }
546 }
547
548 return INDEX_NONE;
549 }
550
551 void Empty(int32 Slack = 0)
552 {
553 // NOTE:
554 // We don't do any invalidating here, that's handled by the FSlotBase, which eventually calls ConditionallyDetatchParentWidget
555
556 // We empty children by first transferring them onto a stack-owned array, then freeing the elements.
557 // This alleviates issues where (misbehaving) destructors on the children may call back into this class and query children while they are being destroyed.
558 // By storing the children on the stack first, we defer the destruction of children until after we have emptied our owned container.
560
561 // Explicitly calling Empty is not really necessary (it is already empty/moved-from now), but we call it for safety
562 Children.Empty();
563
564 // ChildrenCopy will now be emptied and moved back (to preserve any allocated memory)
565 ChildrenCopy.Empty(Slack);
566 Children = MoveTemp(ChildrenCopy);
567 }
568
569 void InsertSlot(typename SlotType::FSlotArguments&& SlotArgument, int32 Index)
570 {
572 check(NewSlot.Get());
573 Children.Insert(MoveTemp(NewSlot), Index);
574 Children[Index]->Construct(*this, MoveTemp(SlotArgument));
575 }
576
578 {
579 {
581 Children.RemoveAt(IndexToMove);
582 Children.Insert(MoveTemp(SlotToMove), IndexToDestination);
583 if constexpr (bSupportSlotWithSlateAttribute)
584 {
585 check(Children.Num() > 0);
586 Children[0]->RequestSortAttribute();
587 }
588 }
589
591 }
592
594 {
595 Children.Reserve(NumToReserve);
596 }
597
599 {
600 return Children.IsValidIndex( Index );
601 }
602
603 const SlotType& operator[](int32 Index) const
604 {
605 return *Children[Index];
606 }
608 {
609 return *Children[Index];
610 }
611
612 template <class PREDICATE_CLASS>
613 void Sort( const PREDICATE_CLASS& Predicate )
614 {
615 if (Children.Num() > 0)
616 {
617 Children.Sort([&Predicate](const TUniquePtr<SlotType>& One, const TUniquePtr<SlotType>& Two)
618 {
619 return Predicate(*One, *Two);
620 });
621
622 if constexpr (bSupportSlotWithSlateAttribute)
623 {
624 Children[0]->RequestSortAttribute();
625 }
626
628 }
629 }
630
631 template <class PREDICATE_CLASS>
632 void StableSort(const PREDICATE_CLASS& Predicate)
633 {
634 if (Children.Num() > 0)
635 {
636 Children.StableSort([&Predicate](const TUniquePtr<SlotType>& One, const TUniquePtr<SlotType>& Two)
637 {
638 return Predicate(*One, *Two);
639 });
640
641 if constexpr (bSupportSlotWithSlateAttribute)
642 {
643 Children[0]->RequestSortAttribute();
644 }
645
647 }
648 }
649
650 void Swap( int32 IndexA, int32 IndexB )
651 {
652 Children.Swap(IndexA, IndexB);
653
654 if constexpr (bSupportSlotWithSlateAttribute)
655 {
656 check(Children.Num() > 0);
657 Children[0]->RequestSortAttribute();
658 }
659
661 }
662
663public:
665 struct FScopedWidgetSlotArguments final : public SlotType::FSlotArguments
666 {
667 public:
675 : SlotType::FSlotArguments(MoveTemp(InSlot))
676 , Children(InChildren)
677 , Index(InIndex)
678 , Added(OnAdded)
679 {
680 }
681
686
688 {
689 if (const SlotType* SlotPtr = this->GetSlot()) // Is nullptr when the FScopedWidgetSlotArguments was moved-constructed.
690 {
691 if (Index == INDEX_NONE)
692 {
693 Index = Children.AddSlot(MoveTemp(*this));
694 }
695 else
696 {
697 Children.InsertSlot(MoveTemp(*this), Index);
698 }
699 if (Added)
700 {
701 Added(SlotPtr, Index);
702 }
703 }
704 }
705
706 private:
707 TPanelChildren<SlotType>& Children;
708 int32 Index;
709 TFunction<void(const SlotType*, int32)> Added;
710 };
711};
712
713
714template<typename SlotType>
716{
717public:
724
731
734 {
735 switch (LayoutFlow)
736 {
737 default:
739 ++Index;
740 break;
742 --Index;
743 break;
744 }
745
746 return *this;
747 }
748
751 {
752 switch (LayoutFlow)
753 {
754 default:
756 --Index;
757 break;
759 ++Index;
760 break;
761 }
762
763 return *this;
764 }
765
766 const SlotType& operator* () const
767 {
768 return Container[Index];
769 }
770
771 const SlotType* operator->() const
772 {
773 return &Container[Index];
774 }
775
777 inline explicit operator bool() const
778 {
779 return Container.IsValidIndex(Index);
780 }
781
784 {
785 return Index;
786 }
787
789 void Reset()
790 {
791 switch (LayoutFlow)
792 {
793 default:
795 Index = 0;
796 break;
798 Index = Container.Num() - 1;
799 break;
800 }
801 }
802
804 void SetToEnd()
805 {
806 switch (LayoutFlow)
807 {
808 default:
810 Index = Container.Num() - 1;
811 break;
813 Index = 0;
814 break;
815 }
816 }
817
818private:
819
820 const TPanelChildren<SlotType>& Container;
821 int32 Index;
822 EFlowDirection LayoutFlow;
823};
824
825
826
834template<typename ChildType>
835class TSlotlessChildren final : public FChildren
836{
837private:
839
840 virtual int32 NumSlot() const override
841 {
842 return 0;
843 }
844
845 virtual const FSlotBase& GetSlotAt(int32 ChildIndex) const override
846 {
847 // @todo slate : slotless children should be removed altogether; for now they return a fake slot.
848 static FSlotBase NullSlot;
849 check(false);
850 return NullSlot;
851 }
852
853 virtual FWidgetRef GetChildRefAt(int32 ChildIndex) override
854 {
855 return FWidgetRef(ReferenceConstruct, Children[ChildIndex].Get());
856 }
857
858 virtual FConstWidgetRef GetChildRefAt(int32 ChildIndex) const override
859 {
860 return FConstWidgetRef(ReferenceConstruct, Children[ChildIndex].Get());
861 }
862
863public:
866 , bChangesInvalidatePrepass(InbChangesInvalidatePrepass)
867 {
868 }
869
870 TSlotlessChildren(std::nullptr_t, bool InbChangesInvalidatePrepass = true) = delete;
871
872 virtual int32 Num() const override
873 {
874 return Children.Num();
875 }
876
878 {
879 return Children[Index];
880 }
881
883 {
884 return Children[Index];
885 }
886
888 {
889 if (bChangesInvalidatePrepass)
890 {
892 }
893
894 int32 Index = Children.Add(Child);
895
897 {
898 Child->AssignParentWidget(GetOwner().AsShared());
899 }
900
901 return Index;
902 }
903
904 void Reset(int32 NewSize = 0)
905 {
906 for (int32 ChildIndex = 0; ChildIndex < Children.Num(); ChildIndex++)
907 {
910 {
911 Child->ConditionallyDetatchParentWidget(&GetOwner());
912 }
913 }
914
915 // We reset children by first transferring them onto a stack-owned array, then freeing the elements.
916 // This alleviates issues where (misbehaving) destructors on the children may call back into this class and query children while they are being destroyed.
917 // By storing the children on the stack first, we defer the destruction of children until after we have reset our owned container.
919
920 // Explicitly calling Reset is not really necessary (it is already empty/moved-from now), but we call it for safety
921 Children.Reset();
922
923 // ChildrenCopy will now be reset and moved back (to preserve any allocated memory)
924 ChildrenCopy.Reset(NewSize);
925 Children = MoveTemp(ChildrenCopy);
926 }
927
928 void Empty(int32 Slack = 0)
929 {
930 for (int32 ChildIndex = 0; ChildIndex < Children.Num(); ChildIndex++)
931 {
934 {
935 Child->ConditionallyDetatchParentWidget(&GetOwner());
936 }
937 }
938
939 // We empty children by first transferring them onto a stack-owned array, then freeing the elements.
940 // This alleviates issues where (misbehaving) destructors on the children may call back into this class and query children while they are being destroyed.
941 // By storing the children on the stack first, we defer the destruction of children until after we have emptied our owned container.
943
944 // Explicitly calling Empty is not really necessary (it is already empty/moved-from now), but we call it for safety
945 Children.Empty();
946
947 // ChildrenCopy will now be emptied and moved back (to preserve any allocated memory)
948 ChildrenCopy.Empty(Slack);
949 Children = MoveTemp(ChildrenCopy);
950 }
951
953 {
954 if (bChangesInvalidatePrepass)
955 {
957 }
958
959 Children.Insert(Child, Index);
961 {
962 Child->AssignParentWidget(GetOwner().AsShared());
963 }
964 }
965
967 {
969 {
970 Child->ConditionallyDetatchParentWidget(&GetOwner());
971 }
972
973 return Children.Remove( Child );
974 }
975
977 {
980 {
981 Child->ConditionallyDetatchParentWidget(&GetOwner());
982 }
983
984 // Note: Child above ensures the instance we're removing from the array won't run its destructor until after it's fully removed from the array
985 Children.RemoveAt( Index );
986 }
987
988 int32 Find( const TSharedRef<ChildType>& Item ) const
989 {
990 return Children.Find( Item );
991 }
992
997
998 const TSharedRef<ChildType>& operator[](int32 Index) const { return Children[Index]; }
1000
1001 template <class PREDICATE_CLASS>
1002 void Sort( const PREDICATE_CLASS& Predicate )
1003 {
1004 Children.Sort( Predicate );
1005 if (bChangesInvalidatePrepass)
1006 {
1008 }
1009 }
1010
1011 void Swap( int32 IndexA, int32 IndexB )
1012 {
1013 Children.Swap(IndexA, IndexB);
1014 if (bChangesInvalidatePrepass)
1015 {
1017 }
1018 }
1019
1020private:
1021 bool bChangesInvalidatePrepass;
1022};
1023
1024
1026template<typename SlotType>
1027class TOneDynamicChild final : public FChildren
1028{
1029public:
1032 , AllChildren(InAllChildren)
1033 , WidgetIndex(InWidgetIndex)
1034 {
1036 check(WidgetIndex);
1037 }
1038
1041 TOneDynamicChild(SWidget* InOwner, std::nullptr_t, std::nullptr_t) = delete;
1042 TOneDynamicChild(std::nullptr_t, TPanelChildren<SlotType>* InAllChildren, std::nullptr_t) = delete;
1043 TOneDynamicChild(std::nullptr_t, std::nullptr_t, const TAttribute<int32>* InWidgetIndex) = delete;
1044 TOneDynamicChild(std::nullptr_t, std::nullptr_t, std::nullptr_t) = delete;
1045
1046 virtual int32 Num() const override { return AllChildren->Num() > 0 ? 1 : 0; }
1047
1049 {
1050 check(Index == 0);
1051 return AllChildren->GetChildAt(WidgetIndex->Get());
1052 }
1053
1055 {
1056 check(Index == 0);
1057 return AllChildren->GetChildAt(WidgetIndex->Get());
1058 }
1059
1060private:
1061 virtual const FSlotBase& GetSlotAt(int32 ChildIndex) const override
1062 {
1063 return (*AllChildren)[ChildIndex];
1064 }
1065
1066 virtual FWidgetRef GetChildRefAt(int32 ChildIndex) override
1067 {
1068 check(ChildIndex == 0);
1069 return static_cast<FChildren*>(AllChildren)->GetChildRefAt(WidgetIndex->Get());
1070 }
1071
1072 virtual FConstWidgetRef GetChildRefAt(int32 ChildIndex) const override
1073 {
1074 check(ChildIndex == 0);
1075 return static_cast<const FChildren*>(AllChildren)->GetChildRefAt(WidgetIndex->Get());
1076 }
1077
1078 TPanelChildren<SlotType>* AllChildren;
1079 const TAttribute<int32>* WidgetIndex;
1080};
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define check(expr)
Definition AssertionMacros.h:314
#define ensure( InExpression)
Definition AssertionMacros.h:464
@ INDEX_NONE
Definition CoreMiscDefines.h:150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define SLATE_SLOT_END_ARGS()
Definition DeclarativeSyntaxSupport.h:386
EFlowDirection
Definition FlowDirection.h:17
const bool
Definition NetworkReplayStreaming.h:178
@ Two
Definition PropertyPathHelpersTest.h:17
@ One
Definition PropertyPathHelpersTest.h:16
EHorizontalAlignment
Definition SlateEnums.h:174
EOrientation
Definition SlateEnums.h:261
EVerticalAlignment
Definition SlateEnums.h:194
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition ChildrenBase.h:27
FChildren(SWidget *InOwner)
Definition ChildrenBase.h:29
@ CopyConstruct
Definition ChildrenBase.h:124
SWidget & GetOwner() const
Definition ChildrenBase.h:57
@ ReferenceConstruct
Definition ChildrenBase.h:125
Definition Children.h:19
virtual const FSlotBase & GetSlotAt(int32 ChildIndex) const override
Definition Children.h:86
virtual TSharedRef< SWidget > GetChildAt(int32 Index) override
Definition Children.h:40
virtual int32 NumSlot() const override
Definition Children.h:75
virtual FWidgetRef GetChildRefAt(int32 Index) override
Definition Children.h:105
virtual int32 Num() const override
Definition Children.h:29
virtual FConstWidgetRef GetChildRefAt(int32 Index) const override
Definition Children.h:122
virtual TSharedRef< const SWidget > GetChildAt(int32 Index) const override
Definition Children.h:57
void AddChildren(FChildren &InLinkedChildren)
Definition Children.h:23
TArray< FChildren * > LinkedChildren
Definition Children.h:140
Definition NameTypes.h:617
Definition Children.h:149
virtual int32 Num() const override
Definition Children.h:164
virtual TSharedRef< const SWidget > GetChildAt(int32) const override
Definition Children.h:174
static SLATECORE_API FNoChildren NoChildrenInstance
Definition Children.h:151
FNoChildren(SWidget *InOwner)
Definition Children.h:154
FNoChildren(SWidget *InOwner, FName InName)
Definition Children.h:159
virtual TSharedRef< SWidget > GetChildAt(int32) override
Definition Children.h:166
Definition Children.h:398
Definition SlotBase.h:14
SLATECORE_API const TSharedPtr< SWidget > DetachWidget()
Definition SlotBase.cpp:46
SLATECORE_API SWidget * GetOwnerWidget() const
Definition SlotBase.cpp:29
void AttachWidget(TSharedRef< SWidget > &&InWidget)
Definition SlotBase.h:47
const TSharedRef< SWidget > & GetWidget() const
Definition SlotBase.h:65
Definition SNullWidget.h:14
static SLATECORE_API TSharedRef< class SWidget > NullWidget
Definition SNullWidget.h:22
Definition SWidget.h:165
SLATECORE_API void Invalidate(EInvalidateWidgetReason InvalidateReason)
Definition SWidget.cpp:1253
Definition BasicLayoutWidgetSlot.h:102
void ConstructMixin(FSlotArgumentsMixin &&InArgs)
Definition BasicLayoutWidgetSlot.h:141
Definition Array.h:670
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
Definition Attribute.h:17
const ObjectType & Get() const
Definition Attribute.h:241
Definition AndroidPlatformMisc.h:14
Definition Children.h:1028
virtual TSharedRef< const SWidget > GetChildAt(int32 Index) const override
Definition Children.h:1054
TOneDynamicChild(std::nullptr_t, std::nullptr_t, const TAttribute< int32 > *InWidgetIndex)=delete
virtual int32 Num() const override
Definition Children.h:1046
TOneDynamicChild(SWidget *InOwner, std::nullptr_t, std::nullptr_t)=delete
virtual TSharedRef< SWidget > GetChildAt(int32 Index) override
Definition Children.h:1048
TOneDynamicChild(std::nullptr_t, TPanelChildren< SlotType > *InAllChildren, std::nullptr_t)=delete
TOneDynamicChild(SWidget *InOwner, TPanelChildren< SlotType > *InAllChildren, const TAttribute< int32 > *InWidgetIndex)
Definition Children.h:1030
TOneDynamicChild(SWidget *InOwner, TPanelChildren< SlotType > *InAllChildren, std::nullptr_t)=delete
TOneDynamicChild(std::nullptr_t, std::nullptr_t, std::nullptr_t)=delete
TOneDynamicChild(SWidget *InOwner, std::nullptr_t, const TAttribute< int32 > *InWidgetIndex)=delete
Definition BasicLayoutWidgetSlot.h:279
Definition Children.h:716
void SetToEnd()
Definition Children.h:804
TPanelChildrenConstIterator< SlotType > & operator++()
Definition Children.h:733
const SlotType * operator->() const
Definition Children.h:771
TPanelChildrenConstIterator< SlotType > & operator--()
Definition Children.h:750
const SlotType & operator*() const
Definition Children.h:766
int32 GetIndex() const
Definition Children.h:783
TPanelChildrenConstIterator(const TPanelChildren< SlotType > &InContainer, EOrientation InOrientation, EFlowDirection InLayoutFlow)
Definition Children.h:725
TPanelChildrenConstIterator(const TPanelChildren< SlotType > &InContainer, EFlowDirection InLayoutFlow)
Definition Children.h:718
void Reset()
Definition Children.h:789
Definition Children.h:461
virtual TSharedRef< SWidget > GetChildAt(int32 Index) override
Definition Children.h:490
void AddSlots(TArray< typename SlotType::FSlotArguments > SlotArguments)
Definition Children.h:515
virtual int32 Num() const override
Definition Children.h:485
void Swap(int32 IndexA, int32 IndexB)
Definition Children.h:650
void Move(int32 IndexToMove, int32 IndexToDestination)
Definition Children.h:577
const SlotType & operator[](int32 Index) const
Definition Children.h:603
void StableSort(const PREDICATE_CLASS &Predicate)
Definition Children.h:632
void Empty(int32 Slack=0)
Definition Children.h:551
virtual FConstWidgetRef GetChildRefAt(int32 ChildIndex) const override
Definition Children.h:477
void Sort(const PREDICATE_CLASS &Predicate)
Definition Children.h:613
SlotType & operator[](int32 Index)
Definition Children.h:607
int32 Remove(const TSharedRef< SWidget > &SlotWidget)
Definition Children.h:537
virtual FWidgetRef GetChildRefAt(int32 ChildIndex) override
Definition Children.h:472
void InsertSlot(typename SlotType::FSlotArguments &&SlotArgument, int32 Index)
Definition Children.h:569
virtual TSharedRef< const SWidget > GetChildAt(int32 Index) const override
Definition Children.h:495
virtual bool SupportSlotWithSlateAttribute() const override
Definition Children.h:500
void Reserve(int32 NumToReserve)
Definition Children.h:593
void RemoveAt(int32 Index)
Definition Children.h:524
bool IsValidIndex(int32 Index) const
Definition Children.h:598
virtual const FSlotBase & GetSlotAt(int32 ChildIndex) const override
Definition Children.h:467
int32 AddSlot(typename SlotType::FSlotArguments &&SlotArgument)
Definition Children.h:506
Definition SharedPointer.h:692
Definition SharedPointer.h:153
TSingleWidgetChildrenWithBasicLayoutSlot(WidgetType *InOwner)
Definition Children.h:417
TSingleWidgetChildrenWithBasicLayoutSlot(std::nullptr_t)=delete
TSingleWidgetChildrenWithBasicLayoutSlot(WidgetType *InOwner, const EHorizontalAlignment InHAlign, const EVerticalAlignment InVAlign)
Definition Children.h:425
SLATE_SLOT_BEGIN_ARGS_TwoMixins(TSingleWidgetChildrenWithBasicLayoutSlot, ParentType, PaddingMixinType, AlignmentMixinType) void Construct(FSlotArguments &&InArgs)
Definition Children.h:436
TSingleWidgetChildrenWithBasicLayoutSlot(std::nullptr_t, const EHorizontalAlignment InHAlign, const EVerticalAlignment InVAlign)=delete
Definition Children.h:302
TSlotBase< SlotType > & AsSlot()
Definition Children.h:356
TSingleWidgetChildrenWithSlot(std::nullptr_t)=delete
TSingleWidgetChildrenWithSlot(SWidget *InOwner, FName InName)
Definition Children.h:310
virtual TSharedRef< const SWidget > GetChildAt(int32 ChildIndex) const override
Definition Children.h:327
TSingleWidgetChildrenWithSlot(SWidget *InOwner)
Definition Children.h:304
SlotType & Expose(SlotType *&OutVarToInit)
Definition Children.h:370
void Construct(FSlotArguments &&InArgs)
Definition Children.h:350
const TSlotBase< SlotType > & AsSlot() const
Definition Children.h:357
SlotType & operator[](const TSharedRef< SWidget > &InChildWidget)
Definition Children.h:364
virtual TSharedRef< SWidget > GetChildAt(int32 ChildIndex) override
Definition Children.h:321
virtual int32 Num() const override
Definition Children.h:319
Definition SlotBase.h:122
@ ConstructSlotIsFChildren
Definition SlotBase.h:145
void Construct(const FChildren &SlotOwner, FSlotArguments &&InArgs)
Definition SlotBase.h:212
Definition Children.h:836
void Swap(int32 IndexA, int32 IndexB)
Definition Children.h:1011
TSlotlessChildren(SWidget *InOwner, bool InbChangesInvalidatePrepass=true)
Definition Children.h:864
void RemoveAt(int32 Index)
Definition Children.h:976
void Insert(const TSharedRef< ChildType > &Child, int32 Index)
Definition Children.h:952
virtual TSharedRef< SWidget > GetChildAt(int32 Index) override
Definition Children.h:877
TSlotlessChildren(std::nullptr_t, bool InbChangesInvalidatePrepass=true)=delete
void Reset(int32 NewSize=0)
Definition Children.h:904
TSharedRef< ChildType > & operator[](int32 Index)
Definition Children.h:999
const TSharedRef< ChildType > & operator[](int32 Index) const
Definition Children.h:998
void Sort(const PREDICATE_CLASS &Predicate)
Definition Children.h:1002
int32 Add(const TSharedRef< ChildType > &Child)
Definition Children.h:887
virtual TSharedRef< const SWidget > GetChildAt(int32 Index) const override
Definition Children.h:882
TArray< TSharedRef< ChildType > > AsArrayCopy() const
Definition Children.h:993
void Empty(int32 Slack=0)
Definition Children.h:928
virtual int32 Num() const override
Definition Children.h:872
int32 Find(const TSharedRef< ChildType > &Item) const
Definition Children.h:988
int32 Remove(const TSharedRef< ChildType > &Child)
Definition Children.h:966
Definition UniquePtr.h:107
Definition Children.h:212
virtual TSharedRef< const SWidget > GetChildAt(int32 ChildIndex) const override
Definition Children.h:227
TSharedRef< SWidget > GetWidget() const
Definition Children.h:287
virtual int32 Num() const override
Definition Children.h:216
void AttachWidget(const TSharedPtr< SWidget > &InWidget)
Definition Children.h:260
virtual TSharedRef< SWidget > GetChildAt(int32 ChildIndex) override
Definition Children.h:221
void DetachWidget()
Definition Children.h:274
Definition SharedPointer.h:1295
UE_FORCEINLINE_HINT TSharedPtr< ObjectType, Mode > Pin() const &
Definition SharedPointer.h:1512
UE_FORCEINLINE_HINT bool IsValid() const
Definition SharedPointer.h:1535
UE_FORCEINLINE_HINT void Reset()
Definition SharedPointer.h:1544
FORCEINLINE T * Get(const FObjectPtr &ObjectPtr)
Definition ObjectPtr.h:426
U16 Index
Definition radfft.cpp:71
Definition ChildrenBase.h:159
Definition ChildrenBase.h:128
FScopedWidgetSlotArguments(TUniquePtr< SlotType > InSlot, TPanelChildren< SlotType > &InChildren, int32 InIndex)
Definition Children.h:668
FScopedWidgetSlotArguments(TUniquePtr< SlotType > InSlot, TPanelChildren< SlotType > &InChildren, int32 InIndex, TFunction< void(const SlotType *, int32)> OnAdded)
Definition Children.h:674
FScopedWidgetSlotArguments(FScopedWidgetSlotArguments &&)=default
FScopedWidgetSlotArguments & operator=(FScopedWidgetSlotArguments &&)=default
~FScopedWidgetSlotArguments()
Definition Children.h:687
FScopedWidgetSlotArguments & operator=(const FScopedWidgetSlotArguments &)=delete
FScopedWidgetSlotArguments(const FScopedWidgetSlotArguments &)=delete
friend TSingleWidgetChildrenWithSlot
Definition Children.h:341
SlotType::FSlotArguments & operator[](const TSharedRef< SWidget > &InChildWidget)
Definition Children.h:343
FSlotArguments()
Definition Children.h:336
void AttachWidget(const TSharedRef< SWidget > &InChildWidget)
Definition SlotBase.h:184