![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <ScopedSlowTask.h>
Inheritance diagram for FScopedSlowTask:Public Member Functions | |
| FScopedSlowTask (float InAmountOfWork, const FText &InDefaultMessage=FText(), bool bInEnabled=true, FFeedbackContext &InContext= *GWarn) | |
| UE_FORCEINLINE_HINT | ~FScopedSlowTask () |
Public Member Functions inherited from FSlowTask | |
| CORE_API | FSlowTask (float InAmountOfWork, const FText &InDefaultMessage=FText(), bool bInEnabled=true, FFeedbackContext &InContext= *GWarn) |
| CORE_API void | Initialize () |
| CORE_API void | Destroy () |
| CORE_API void | MakeDialogDelayed (float Threshold, bool bShowCancelButton=false, bool bAllowInPIE=false) |
| CORE_API void | MakeDialog (bool bShowCancelButton=false, bool bAllowInPIE=false) |
| CORE_API void | EnterProgressFrame (float ExpectedWorkThisFrame=1.f, const FText &Text=FText()) |
| CORE_API void | TickProgress () |
| CORE_API void | ForceRefresh () |
| CORE_API const FText & | GetCurrentMessage () const |
| CORE_API bool | ShouldCancel () const |
Additional Inherited Members | |
Static Public Member Functions inherited from FSlowTask | |
| static CORE_API bool | ShouldCreateThrottledSlowTask () |
Public Attributes inherited from FSlowTask | |
| FText | DefaultMessage |
| FText | FrameMessage |
| float | TotalAmountOfWork |
| float | CompletedWork |
| float | CurrentFrameScope |
| ESlowTaskVisibility | Visibility |
| double | StartTime |
| TOptional< float > | OpenDialogThreshold |
A scope block representing an amount of work divided up into sections. Use one scope at the top of each function to give accurate feedback to the user of a slow operation's progress.
Example Usage: void DoSlowWork() { FScopedSlowTask Progress(2.f, LOCTEXT("DoingSlowWork", "Doing Slow Work...")); // Optionally make this show a dialog if not already shown Progress.MakeDialog();
// Indicate that we are entering a frame representing 1 unit of work Progress.EnterProgressFrame(1.f);
// DoFirstThing() can follow a similar pattern of creating a scope divided into frames. These contribute to their parent's progress frame proportionately. DoFirstThing();
Progress.EnterProgressFrame(1.f); DoSecondThing(); }
|
inline |
Construct this scope from an amount of work to do, and a message to display
| InAmountOfWork | Arbitrary number of work units to perform (can be a percentage or number of steps). 0 indicates that no progress frames are to be entered in this scope (automatically enters a frame encompassing the entire scope) |
| InDefaultMessage | A message to display to the user to describe the purpose of the scope |
| bInEnabled | When false, this scope will have no effect. Allows for proper scoped objects that are conditionally disabled. |
|
inline |