Unreal Engine Slate UI examples
Push Button

Adding this to some AActor, component etc. adds a push button to the "Details" pannel:
// .hpp
UFUNCTION(BlueprintCallable, CallInEditor)
void myFun();
// .cpp
// Callback when pushed
void AMyActor::myFun() {
UE_LOG(LogTemp, Error, TEXT("This is a test"));
}
Progress Bar
Block access to editor's UI with a progress bar when launching a time consuming operation:

FScopedSlowTask SomeTask(List.Num(), FText::FromString(TEXT("Do stuff")));
SomeTask.MakeDialog();
for (int32 Index = 0; Index < List.Num(); ++Index)
{
SomeTask.EnterProgressFrame();
}
Other resources
- https://docs.unrealengine.com/4.26/en-US/ProgrammingAndScripting/Slate/Widgets/
- https://ikrima.dev/ue4guide/editor-extensions/slate/useful-slate-code-samples/
No comments