A base type that defines TSlateNestedAttributes. These nested Attributes are similar to regular TSlateAttributes but can be defined outside a widget as long as the type owning the TSlateNestedAttributes is inside a widget.
Example implementation: //------.hstructSWidgetWithNestedAttributes;structFSimpleNestedAttributesOwner:publicFSlateNestedAttributeContainer//Definethetypeowningourattributes{staticvoidRegisterNestedAttributes(FSlateAttributeInitializer&AttributeInitializer,FSimpleNestedAttributesOwnerSWidgetWithNestedAttributes::*InPointerToOwner);FSimpleNestedAttributesOwner(SWidgetWithNestedAttributes&Owner);voidSetNestedIntAttribute(TAttributeAttr);intGetNestedIntAttr()const{returnNestedIntAttribute.Get();}voidSetNestedFloatAttribute(TAttributeAttr);floatGetNestedFloatAttr()const{returnNestedFloatAttribute.Get();}private:staticvoidOnNestedIntAttributeChanged(SWidget&OwningWidget,FSimpleNestedAttributesOwner&NestedAttributesOwner);staticvoidOnNestedFloatAttributeChanged(SWidgetWithNestedAttributes&OwningWidget,FSimpleNestedAttributesOwner&NestedAttributesOwner);SWidgetWithNestedAttributes&Owner;//WeneedtokeeptrackoftheowningwidgettocallAssignontheattributeTSlateNestedAttributeNestedIntAttribute;//<---ThenestedattributeTSlateNestedAttributeNestedFloatAttribute;//<---Thenestedattribute};structSWidgetWithNestedAttributes:publicSCompoundWidget{SLATE_DECLARE_WIDGET(SWidgetWithNestedAttributes,SWidget)public:SLATE_BEGIN_ARGS(SWidgetWithNestedAttributes){}SLATE_END_ARGS()SWidgetWithNestedAttributes():NestedAttributes(*this){}voidConstruct(constFArguments&InArgs);voidSetNestedIntAttribute(TAttributeAttr){NestedAttributes.SetNestedIntAttribute(MoveTemp(Attr));}voidSetNestedFloatAttribute(TAttributeAttr){NestedAttributes.SetNestedFloatAttribute(MoveTemp(Attr));}intGetNestedIntAttribute()const{returnNestedAttributes.GetNestedIntAttr();}floatGetNestedFloatAttribute()const{returnNestedAttributes.GetNestedFloatAttr();}private:FSimpleNestedAttributesOwnerNestedAttributes;//<--Thewidgethasafieldtoourcustomstructthatcontainstheattributes};//------.cppvoidFSimpleNestedAttributesOwner::RegisterNestedAttributes(FSlateAttributeInitializer&AttributeInitializer,FSimpleNestedAttributesOwnerSWidgetWithNestedAttributes::*InPointerToOwner){//Herewedefinethenestedattributes.WeneedtoknowwhichmemberofthewidgetownsthistypeSLATE_ADD_NESTED_MEMBER_ATTRIBUTE_DEFINITION(AttributeInitializer,InPointerToOwner,NestedIntAttribute,EInvalidateWidgetReason::Paint).OnValueChanged_Static(OnNestedIntAttributeChanged);SLATE_ADD_NESTED_MEMBER_ATTRIBUTE_DEFINITION(AttributeInitializer,InPointerToOwner,NestedFloatAttribute,constSWidgetWithNestedAttributes&OwningWidget,constFSimpleNestedAttributesOwner&NestedAttributes{UE_LOGF(LogTemp,Warning,"InGetInvalidationReason:valuechangedto:%f(directaccess:%f)",OwningWidget.GetNestedFloatAttribute(),NestedAttributes.GetNestedFloatAttr())returnEInvalidateWidgetReason::Paint;}).OnValueChanged_Static(OnNestedFloatAttributeChanged);}FSimpleNestedAttributesOwner::FSimpleNestedAttributesOwner(SWidgetWithNestedAttributes&Owner):Owner(Owner),NestedIntAttribute(Owner),NestedFloatAttribute(Owner){}voidFSimpleNestedAttributesOwner::SetNestedIntAttribute(TAttributeAttr){NestedIntAttribute.Assign(Owner,MoveTemp(Attr));}voidFSimpleNestedAttributesOwner::SetNestedFloatAttribute(TAttributeAttr){NestedFloatAttribute.Assign(Owner,MoveTemp(Attr));}voidFSimpleNestedAttributesOwner::OnNestedIntAttributeChanged(SWidget&OwningWidget,FSimpleNestedAttributesOwner&NestedAttributesOwner){//TheOnValueChangeddefinitionisslightlydifferentfromaregularTSlateAttribute,alsoprovidingwithareferencetoourcontainertypeSWidgetWithNestedAttributes&Widget=static_cast(OwningWidget);UE_LOGF(LogTemp,Warning,"OnNestedIntAttributeChanged:valuechangedto:%d(directaccess:%d)",Widget.GetNestedIntAttribute(),NestedAttributesOwner.GetNestedIntAttr())}voidFSimpleNestedAttributesOwner::OnNestedFloatAttributeChanged(SWidgetWithNestedAttributes&OwningWidget,FSimpleNestedAttributesOwner&NestedAttributesOwner){UE_LOGF(LogTemp,Warning,"OnNestedFloatAttributeChanged:valuechangedto:%f(directaccess:%f)",OwningWidget.GetNestedFloatAttribute(),NestedAttributesOwner.GetNestedFloatAttr())}SLATE_IMPLEMENT_WIDGET(SWidgetWithNestedAttributes)voidSWidgetWithNestedAttributes::PrivateRegisterAttributes(FSlateAttributeInitializer&AttributeInitializer){FSimpleNestedAttributesOwner::RegisterNestedAttributes(AttributeInitializer,&SWidgetWithNestedAttributes::NestedAttributes);}voidSWidgetWithNestedAttributes::Construct(constFArguments&InArgs){}