Download

How to properly reference an EditorUtilityWidgetBlueprint in C++ (using ConstructorHelpers)

Hey,

I’m working on a project for university and I want to do a plugin that opens an EditorUtilityWidgetBlueprint when pressing the toolbar button.

Unfortunately I can not seem to get the reference to the Widget right.

This is what I currently tried:

void FPlugiModule::PluginButtonClicked()
{

static ConstructorHelpers::FClassFinder<UEditorUtilityWidgetBlueprint> BBObj(TEXT("/Game/BB"));
if (BBObj.Succeeded()) {
	//MenuClass is TSubclassOf<class UEditorUtilityWidgetBlueprint> MenuClass;
	MenuClass = BBObj.Class;
}

//Does not work as it can't convert UClass to UEditorUtilityWidgetBlueprint
RunEditorUtilityWidget(MenuClass.Get()); //RunEditorUtilityWidget(UEditorUtilityWidgetBlueprint*)

}

Does anyone have an idea how to properly reference the EditorUtilityWidgetBlueprint, as I found no information about referencing these Widgets?

// btw: Names of Class and Blueprint are placeholder, as I’m testing in a separate project

Best regards

EDIT: I tried using CreateWidget and CreateUtilityWidget, but without success, maybe I did something wrong?
How would you go on about using the found class from FClassFinder to get a reference to the Widget?