bool UPanelWidget::RemoveChildAt(int32 Index) { if ( Index < 0 || Index >= Slots.Num() ) { return false; } UPanelSlot* PanelSlot = Slots[Index]; if ( PanelSlot->Content ) { PanelSlot->Content->Slot = nullptr; } Slots.RemoveAt(Index); OnSlotRemoved(PanelSlot); const bool bReleaseChildren = true; PanelSlot->ReleaseSlateResources(bReleaseChildren); PanelSlot->Parent = nullptr; PanelSlot->Content = nullptr; InvalidateLayoutAndVolatility(); return true; }
bool UJavascriptWidget::RemoveChild() { if (!ContentSlot) return false; if (ContentSlot->Content) { ContentSlot->Content->Slot = nullptr; } OnSlotRemoved(Slot); const bool bReleaseChildren = true; ContentSlot->ReleaseSlateResources(bReleaseChildren); ContentSlot->Parent = nullptr; ContentSlot->Content = nullptr; return true; }