UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SlowTask.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreGlobals.h"
6#include "CoreTypes.h"
8#include "Misc/Optional.h"
9
11
14{
16 Default,
23};
24
29{
32
35
38
41
44
47
49 double StartTime;
50
53
54private:
55
57 bool bEnabled;
58
60 bool bCreatedDialog;
61
63 FFeedbackContext& Context;
64
66 bool bDelayedDialogShowCancelButton : 1;
67
69 bool bDelayedDialogAllowInPIE : 1;
70
72 bool bSkipRecursiveDialogCreation : 1;
73
75 uint64 RegionId;
76
78 FSlowTask(const FSlowTask&);
79
81 static void ForceRefresh(FFeedbackContext& Context);
82
84 bool MakeDialogIfNeeded();
85
87 void MakeRecursiveDialogIfNeeded();
88
89public:
90
95
104
106 CORE_API void Initialize();
107
109 CORE_API void Destroy();
110
117 CORE_API void MakeDialogDelayed(float Threshold, bool bShowCancelButton = false, bool bAllowInPIE = false);
118
124 CORE_API void MakeDialog(bool bShowCancelButton = false, bool bAllowInPIE = false);
125
131 CORE_API void EnterProgressFrame(float ExpectedWorkThisFrame = 1.f, const FText& Text = FText());
132
136 CORE_API void TickProgress();
137
142 CORE_API void ForceRefresh();
143
147 CORE_API const FText& GetCurrentMessage() const;
148
152 CORE_API bool ShouldCancel() const;
153};
CORE_API FFeedbackContext * GWarn
Definition CoreGlobals.cpp:53
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
ESlowTaskVisibility
Definition SlowTask.h:14
Definition FeedbackContext.h:30
Definition Text.h:385
Definition SlowTask.h:29
FText DefaultMessage
Definition SlowTask.h:31
CORE_API void MakeDialogDelayed(float Threshold, bool bShowCancelButton=false, bool bAllowInPIE=false)
Definition SlowTask.cpp:170
ESlowTaskVisibility Visibility
Definition SlowTask.h:46
double StartTime
Definition SlowTask.h:49
static CORE_API bool ShouldCreateThrottledSlowTask()
Definition SlowTask.cpp:26
FText FrameMessage
Definition SlowTask.h:34
CORE_API bool ShouldCancel() const
Definition SlowTask.cpp:248
CORE_API void TickProgress()
Definition SlowTask.cpp:203
CORE_API void Destroy()
Definition SlowTask.cpp:121
float TotalAmountOfWork
Definition SlowTask.h:37
float CurrentFrameScope
Definition SlowTask.h:43
CORE_API void Initialize()
Definition SlowTask.cpp:99
CORE_API const FText & GetCurrentMessage() const
Definition SlowTask.cpp:226
CORE_API void EnterProgressFrame(float ExpectedWorkThisFrame=1.f, const FText &Text=FText())
Definition SlowTask.cpp:177
TOptional< float > OpenDialogThreshold
Definition SlowTask.h:52
CORE_API void ForceRefresh()
Definition SlowTask.cpp:218
float CompletedWork
Definition SlowTask.h:40
CORE_API void MakeDialog(bool bShowCancelButton=false, bool bAllowInPIE=false)
Definition SlowTask.cpp:231
Definition Optional.h:131