Add multiple slots at the same time with the declarative syntax derived from an input data array.
More...
template<CRangeMember Range, CFunctionLike Transform, CFunctionLike OnEmpty = TUniqueFunction<TFunction_Return<Transform>()>, CSlotArguments = TFunction_Return<Transform>>
requires (
TFunction_ArgCount<Transform> == 1)
struct Mcro::Slate::TSlots< Range, Transform, OnEmpty, CSlotArguments >
Add multiple slots at the same time with the declarative syntax derived from an input data array.
void SMyWidget::Construct(const FArguments& args)
{
ChildSlot
[
SNew(SVerticalBox)
+
TSlots(args._DataArray, [](
const FMyData& data)
{
FText dataText = FText::FromString(data.ToString());
return SVerticalBox::Slot()
. HAlign(HAlign_Fill)
. AutoHeight()
[
SNew(STextBlock)
. Text(dataText)
];
})
+ SVerticalBox::Slot()
. HAlign(HAlign_Fill)
. AutoHeight()
[
SNew(STextBlock)
. Text(
INVTEXT_"Footer after the list of data")
]
];
}
#define INVTEXT_
A convenience alternative to Unreal's own INVTEXT macro but this one doesn't require parenthesis arou...
Extra functionalities for general Slate programming chores, including enhancements of the Slate decla...
TSlots(Range const &range, Transform &&transform, TOptional< OnEmpty > &&onEmpty={})
Definition at line 194 of file Slate.h.
template<CRangeMember Range, CFunctionLike Transform, CFunctionLike OnEmpty = TUniqueFunction<TFunction_Return<Transform>()>, CSlotArguments = TFunction_Return<Transform>>
template<CWidgetArguments Arguments>
Arguments & operator+ |
( |
Arguments & | args, |
|
|
TSlots< Range, Transform, OnEmpty, CSlotArguments > && | slots ) |
|
friend |