In widget designer, set variable to reference another widget

I have some customised widgets for various UI components and all are working well.

When attempting to simplify their use and remove as much code/Blueprint involvement for the design team, I am hitting a snag.

My custom widget spawns other widgets into a custom container widget. To do this it needs to be told which container to spawn them into (as this is placed at design time). Now in the class I have defined a UPROPERTY for the target container widget like so:

UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Widget Spawner")
UPanelWidget* targetPanel = nullptr;

When I attempt to set this in the editor to point to the instance of the container widget I wish to use, I click the drop down list box and the possibilities (UPanelWidgets that have been flagged as is variable) are listed. However, when I select ANY of them, the drop down closes and nothing is set!

Have I missed something in my property definition? or is this an editor bug?

UE4 does not set those automatically C++ and Blueprint variables cant really abstract to each other, UE4 treats them sepretly. you either need to set this property in blueprint or use meta = (BindWidget) specifier on UPROPERTY which will spawn widget if you making UUserWidget

Note that in C++ you can use Slate directly by making your own UWidget in RebuildWidget function, you might find it easier to use.

Thanks for the reply, good to know it’s not possible and I can look at an alternate solution.