How to change uwidget alignment on/after construction?

Have no idea how to align/realign uwidgets via c++.
I have a following widget structure: UButton->UOverlay->UImage.
Have to make UOverlay to HFill and VFill the UButton

Figured out the solution. Add child returns a panel slot, which we can then cast to a button slot and use it to set alignment

Edit: Doesn’t work. Crashes the engine

Does work. That’s exactly how you do it: get the slot, cast to the appropriate slot type, and do the thing. Where does it crash?