Hi,
How do i share a SVerticalBox between blueprint and c++ ?
I’d like to fill a SVerticalBox in c++.
I see two possible strategies:
-
create the SVerticalBox in c++ and expose it to the BP
-
create the SVerticalBox in the BP and pass it to an exposed c++ function
I could succeed in none of those.
The following code is in the UUserWidget that the BP inherits from.
The problem is that those 4 tries give me an “unrecognized type” at compilation (TSharedPrt or SVerticalBox).
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = yag)
SVerticalBox* ResolutionBox;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = yag)
TSharedPtr<SVerticalBox> ResolutionBox;
UFUNCTION(BlueprintCallable, Category = "Yag")
void SetupResolutions(SVerticalBox* ResolutionBox);
UFUNCTION(BlueprintCallable, Category = "Yag")
void SetupResolutions(TSharedPtr<SVerticalBox> ResolutionBox);
This one:
UFUNCTION(BlueprintCallable, Category = "Yag")
void SetupResolutions(UUserWidget* UResolutionBox);
is compiling but within my function i don’t know how to go from a UUserWidget to a SVerticalBox.
I tried different combinations of Casting, TSharedRef, TSharedPtr, couldn’t find one that works.
Thanks for any pointers (pun almost intended^^) in the right direction !
Cedric