UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SlateDebugging.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
8#include "Input/Reply.h"
12
13#include "SlateDebugging.generated.h"
14
15#ifndef WITH_SLATE_DEBUGGING
16 #define WITH_SLATE_DEBUGGING !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
17#endif
18
19#ifndef SLATE_CSV_TRACKER
20 #define SLATE_CSV_TRACKER CSV_PROFILER_STATS
21#endif
22
23// Enabled to build a list of all the SWidget currently constructed
24#ifndef UE_WITH_SLATE_DEBUG_WIDGETLIST
25 #define UE_WITH_SLATE_DEBUG_WIDGETLIST UE_SLATE_WITH_MEMBER_ATTRIBUTE_DEBUGGING
26#endif
27
28class SWindow;
29class SWidget;
30struct FGeometry;
31class FPaintArgs;
34class FSlateRect;
35class FWeakWidgetPath;
36class FWidgetPath;
39enum class EElementType : uint8;
40
41UENUM()
72
73UENUM()
79
80UENUM()
90
104
115
134
135UENUM()
143
144
145#if WITH_SLATE_DEBUGGING
146
147
169
189
191{
192public:
193};
194
208
226
228{
229 None = 0,
230 ChildOrder = 1 << 0,
231 Root = 1 << 1,
232 ScreenPosition = 1 << 2,
233};
234
236
240
258
276
281{
282public:
286
290
292 DECLARE_MULTICAST_DELEGATE_SixParams(FBeginWidgetPaint, const SWidget* /*Widget*/, const FPaintArgs& /*Args*/, const FGeometry& /*AllottedGeometry*/, const FSlateRect& /*MyCullingRect*/, const FSlateWindowElementList& /*OutDrawElements*/, int32 /*LayerId*/);
294
296 DECLARE_MULTICAST_DELEGATE_ThreeParams(FEndWidgetPaint, const SWidget* /*Widget*/, const FSlateWindowElementList& /*OutDrawElements*/, int32 /*LayerId*/);
298
302
306
308 DECLARE_MULTICAST_DELEGATE_FourParams(FPaintDebugElements, const FPaintArgs& /*InArgs*/, const FGeometry& /*InAllottedGeometry*/, FSlateWindowElementList& /*InOutDrawElements*/, int32& /*InOutLayerId*/);
310
315 UE_DEPRECATED(5.2, "FSlateDebugging::ElementAdded is deprecated, use FSlateDebugging::ElementTypeAdded instead")
320
327
328public:
332 static SLATECORE_API void BroadcastWarning(const FText& WarningText, const TSharedPtr<SWidget>& OptionalContextWidget);
333
334public:
338
342 static SLATECORE_API void BroadcastInputEvent(ESlateDebuggingInputEvent InputEventType, const FInputEvent* InInputEvent, const FReply& InReply, const TSharedPtr<SWidget>& HandlerWidget, const FString& AdditionalContent);
343 static SLATECORE_API void BroadcastInputEvent(ESlateDebuggingInputEvent InputEventType, const FInputEvent* InInputEvent, const FReply& InReply, const TSharedPtr<SWidget>& HandlerWidget, const FName& AdditionalContent);
344 static SLATECORE_API void BroadcastInputEvent(ESlateDebuggingInputEvent InputEventType, const FInputEvent* InInputEvent, const FReply& InReply, const TSharedPtr<SWidget>& HandlerWidget, const TCHAR AdditionalContent);
346
347public:
355
363
366
369 {
370 virtual void OnProcessInput(ESlateDebuggingInputEvent InputEventType, const FInputEvent& Event) = 0;
371 virtual void OnPreProcessInput(ESlateDebuggingInputEvent InputEventType, const TCHAR* InputPrecessorName, bool bHandled) = 0;
372 virtual void OnRouteInput(ESlateDebuggingInputEvent InputEventType, const FName& RoutedType) = 0;
373 virtual void OnInputEvent(ESlateDebuggingInputEvent InputEventType, const FReply& InReply, const TSharedPtr<SWidget>& HandlerWidget) = 0;
374 virtual void OnInputRouted(ESlateDebuggingInputEvent InputEventType) = 0;
375 virtual void OnInputProcessed(ESlateDebuggingInputEvent InputEventType) = 0;
376 };
377
380
381public:
385
389
390public:
394
396
400
402
403public:
407
410
411public:
414
416
417public:
420
421 static SLATECORE_API void BroadcastWidgetInvalidate(const SWidget* WidgetInvalidated, const SWidget* WidgetInvalidateInvestigator, EInvalidateWidgetReason InvalidateReason);
422 static SLATECORE_API void BroadcastInvalidationRootInvalidate(const SWidget* WidgetInvalidated, const SWidget* WidgetInvalidateInvestigator, ESlateDebuggingInvalidateRootReason InvalidateReason);
423
424public:
427
430
431public:
433 DECLARE_MULTICAST_DELEGATE_TwoParams(FUICommandRun, const FName& /*CommandName*/, const FText& /*CommandLabel*/);
435
438
439private:
440
441 // This class is only for namespace use
442 FSlateDebugging() = delete;
443
444 struct FLastCursorQuery
445 {
446 const SWidget* WidgetThatOverrideCursorLast_UnsafeToUseForAnythingButCompare = nullptr;
447 TWeakPtr<SWidget> CursorWidget;
448 EMouseCursor::Type MouseCursor;
449 };
450 static FLastCursorQuery LastCursorQuery;
451
452 static TArray<IWidgetInputRoutingEvent*> RoutingEvents;
453};
454
455#endif
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_MULTICAST_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:58
#define DECLARE_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:49
EElementType
Definition DrawElementCoreTypes.h:35
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
EInvalidateWidgetReason
Definition InvalidateWidgetReason.h:14
#define UENUM(...)
Definition ObjectMacros.h:749
SLATECORE_API FString LexToString(ESlateDebuggingInvalidateRootReason Reason)
ESlateDebuggingStateChangeEvent
Definition SlateDebugging.h:75
SLATECORE_API void LexFromString(ESlateDebuggingInvalidateRootReason &OutMode, const TCHAR *InBuffer)
ESlateDebuggingNavigationMethod
Definition SlateDebugging.h:82
SLATECORE_API bool LexTryParseString(ESlateDebuggingInvalidateRootReason &OutMode, const TCHAR *InBuffer)
ESlateDebuggingFocusEvent
Definition SlateDebugging.h:137
ESlateDebuggingInputEvent
Definition SlateDebugging.h:43
ESlateDebuggingInvalidateRootReason
Definition SlateDebugging.h:228
EWidgetUpdateFlags
Definition WidgetUpdateFlags.h:9
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition CursorReply.h:16
Definition NameTypes.h:617
Definition NavigationReply.h:43
Definition PaintArgs.h:23
Definition Reply.h:24
Definition SlateDebugging.h:281
static SLATECORE_API void BroadcastInputEvent(ESlateDebuggingInputEvent InputEventType, const FInputEvent *InInputEvent, const FReply &InReply)
static SLATECORE_API FDrawElementType ElementTypeAdded
Definition SlateDebugging.h:326
static SLATECORE_API void BroadcastExecuteNavigation()
static SLATECORE_API void BroadcastWidgetInvalidate(const SWidget *WidgetInvalidated, const SWidget *WidgetInvalidateInvestigator, EInvalidateWidgetReason InvalidateReason)
static SLATECORE_API const TArray< const SWidget * > & GetAllWidgets()
DECLARE_MULTICAST_DELEGATE_OneParam(FBeginWindow, const FSlateWindowElementList &)
static SLATECORE_API FBeginWindow BeginWindow
Definition SlateDebugging.h:285
static SLATECORE_API void RegisterWidgetInputRoutingEvent(IWidgetInputRoutingEvent *Event)
static SLATECORE_API void BroadcastCursorQuery(TSharedPtr< const SWidget > InWidgetOverridingCursor, const FCursorReply &InReply)
DECLARE_MULTICAST_DELEGATE_OneParam(FWidgetCursorQuery, const FSlateDebuggingCursorQueryEventArgs &)
static SLATECORE_API FWidgetInputEvent InputEvent
Definition SlateDebugging.h:337
SLATECORE_API static PRAGMA_DISABLE_DEPRECATION_WARNINGS FDrawElement ElementAdded
Definition SlateDebugging.h:318
static SLATECORE_API FWidgetMouseCaptureEvent MouseCaptureEvent
Definition SlateDebugging.h:406
static SLATECORE_API void BroadcastInvalidationRootInvalidate(const SWidget *WidgetInvalidated, const SWidget *WidgetInvalidateInvestigator, ESlateDebuggingInvalidateRootReason InvalidateReason)
DECLARE_MULTICAST_DELEGATE_OneParam(FBeginWidgetPrepass, const SWidget *)
DECLARE_MULTICAST_DELEGATE_FourParams(FPaintDebugElements, const FPaintArgs &, const FGeometry &, FSlateWindowElementList &, int32 &)
static SLATECORE_API FWidgetUpdatedEvent WidgetUpdatedEvent
Definition SlateDebugging.h:426
DECLARE_MULTICAST_DELEGATE_OneParam(FWidgetUpdatedEvent, const FSlateDebuggingWidgetUpdatedEventArgs &)
static SLATECORE_API void BroadcastFocusReceived(const FFocusEvent &InFocusEvent, const FWeakWidgetPath &InOldFocusedWidgetPath, const TSharedPtr< SWidget > &InOldFocusedWidget, const FWidgetPath &InNewFocusedWidgetPath, const TSharedPtr< SWidget > &InNewFocusedWidget)
static SLATECORE_API FWidgetAttemptNavigationEvent AttemptNavigationEvent
Definition SlateDebugging.h:393
static SLATECORE_API void BroadcastMouseCapture(uint32 UserIndex, uint32 PointerIndex, TSharedPtr< const SWidget > InCapturingWidget)
static SLATECORE_API FWidgetWarningEvent Warning
Definition SlateDebugging.h:331
static SLATECORE_API void BroadcastMouseCaptureLost(uint32 UserIndex, uint32 PointerIndex, TSharedPtr< const SWidget > InWidgetLostCapture)
DECLARE_MULTICAST_DELEGATE_OneParam(FWidgetAttemptNavigationEvent, const FSlateDebuggingNavigationEventArgs &)
static SLATECORE_API FEndWidgetPrepass EndWidgetPrepass
Definition SlateDebugging.h:305
static SLATECORE_API FPaintDebugElements PaintDebugElements
Definition SlateDebugging.h:309
static SLATECORE_API void BroadcastPreProcessInputEvent(ESlateDebuggingInputEvent InputEventType, const TCHAR *InputPrecessorName, bool bHandled)
static SLATECORE_API FEndWindow EndWindow
Definition SlateDebugging.h:289
static SLATECORE_API void BroadcastWidgetUpdatedByPaint(const SWidget *Invalidated, EWidgetUpdateFlags UpdateFlags)
static SLATECORE_API FUICommandRun CommandRun
Definition SlateDebugging.h:434
static SLATECORE_API void ExportWidgetList(FStringView Filename)
DECLARE_MULTICAST_DELEGATE_OneParam(FWidgetExecuteNavigationEvent, const FSlateDebuggingExecuteNavigationEventArgs &)
DECLARE_MULTICAST_DELEGATE_TwoParams(FUICommandRun, const FName &, const FText &)
static SLATECORE_API void BroadcastWarning(const FText &WarningText, const TSharedPtr< SWidget > &OptionalContextWidget)
static SLATECORE_API void BroadcastFocusLost(const FFocusEvent &InFocusEvent, const FWeakWidgetPath &InOldFocusedWidgetPath, const TSharedPtr< SWidget > &InOldFocusedWidget, const FWidgetPath &InNewFocusedWidgetPath, const TSharedPtr< SWidget > &InNewFocusedWidget)
DECLARE_MULTICAST_DELEGATE_OneParam(FEndWidgetPrepass, const SWidget *)
static SLATECORE_API FWidgetInvalidate WidgetInvalidateEvent
Definition SlateDebugging.h:419
static SLATECORE_API void BroadcastAttemptNavigation(const FNavigationEvent &InNavigationEvent, const FNavigationReply &InNavigationReply, const FWidgetPath &InNavigationSource, const TSharedPtr< SWidget > &InDestinationWidget, ESlateDebuggingNavigationMethod InNavigationMethod)
static SLATECORE_API FBeginWidgetPrepass BeginWidgetPrepass
Definition SlateDebugging.h:301
static SLATECORE_API void BroadcastFocusChanging(const FFocusEvent &InFocusEvent, const FWeakWidgetPath &InOldFocusedWidgetPath, const TSharedPtr< SWidget > &InOldFocusedWidget, const FWidgetPath &InNewFocusedWidgetPath, const TSharedPtr< SWidget > &InNewFocusedWidget)
static SLATECORE_API void BroadcastWidgetUpdated(const SWidget *Invalidated, EWidgetUpdateFlags UpdateFlags)
DECLARE_MULTICAST_DELEGATE_OneParam(FWidgetFocusEvent, const FSlateDebuggingFocusEventArgs &)
DECLARE_MULTICAST_DELEGATE_OneParam(FWidgetInvalidate, const FSlateDebuggingInvalidateArgs &)
static SLATECORE_API FWidgetCursorQuery CursorChangedEvent
Definition SlateDebugging.h:413
static SLATECORE_API FWidgetExecuteNavigationEvent ExecuteNavigationEvent
Definition SlateDebugging.h:399
DECLARE_MULTICAST_DELEGATE_ThreeParams(FEndWidgetPaint, const SWidget *, const FSlateWindowElementList &, int32)
static SLATECORE_API void BroadcastNoReplyInputEvent(ESlateDebuggingInputEvent InputEventType, const FInputEvent *InInputEvent, const TSharedPtr< SWidget > &HandlerWidget)
DECLARE_MULTICAST_DELEGATE_OneParam(FEndWindow, const FSlateWindowElementList &)
DECLARE_MULTICAST_DELEGATE_SixParams(FBeginWidgetPaint, const SWidget *, const FPaintArgs &, const FGeometry &, const FSlateRect &, const FSlateWindowElementList &, int32)
static SLATECORE_API FBeginWidgetPaint BeginWidgetPaint
Definition SlateDebugging.h:293
static SLATECORE_API FWidgetFocusEvent FocusEvent
Definition SlateDebugging.h:384
static SLATECORE_API FEndWidgetPaint EndWidgetPaint
Definition SlateDebugging.h:297
static SLATECORE_API void UnregisterWidgetInputRoutingEvent(IWidgetInputRoutingEvent *Event)
DECLARE_MULTICAST_DELEGATE_OneParam(FWidgetMouseCaptureEvent, const FSlateDebuggingMouseCaptureEventArgs &)
Definition DrawElementTypes.h:46
Definition SlateInvalidationRoot.h:77
Definition SlateRect.h:26
Definition DrawElements.h:220
Definition Text.h:385
Definition WidgetPath.h:213
Definition WidgetPath.h:51
Definition SWidget.h:165
Definition SWindow.h:243
Definition Array.h:670
Definition SharedPointer.h:692
Definition SharedPointer.h:1295
UpdateFlags
Definition DetourCrowd.h:208
Type
Definition ICursor.h:18
Definition Events.h:51
Definition Geometry.h:40
Definition Events.h:155
Definition Events.h:1148
Definition SlateDebugging.h:106
const FCursorReply & Reply
Definition SlateDebugging.h:111
SLATECORE_API FText ToText() const
SLATECORE_API FSlateDebuggingCursorQueryEventArgs(const TSharedPtr< const SWidget > &InWidgetOverridingCursor, const FCursorReply &InReply)
const TSharedPtr< const SWidget > & WidgetOverridingCursor
Definition SlateDebugging.h:110
Definition SlateDebugging.h:117
int32 ElementIndex
Definition SlateDebugging.h:129
EElementType ElementType
Definition SlateDebugging.h:132
const FSlateWindowElementList & ElementList
Definition SlateDebugging.h:126
SLATECORE_API FSlateDebuggingElementTypeAddedEventArgs(const FSlateWindowElementList &InElementList, int32 InElementIndex, EElementType InElementType)
Definition SlateDebugging.h:191
Definition SlateDebugging.h:149
SLATECORE_API FText ToText() const
const TSharedPtr< SWidget > & NewFocusedWidget
Definition SlateDebugging.h:165
const FWidgetPath & NewFocusedWidgetPath
Definition SlateDebugging.h:164
const FWeakWidgetPath & OldFocusedWidgetPath
Definition SlateDebugging.h:162
const FFocusEvent & FocusEvent
Definition SlateDebugging.h:161
const TSharedPtr< SWidget > & OldFocusedWidget
Definition SlateDebugging.h:163
SLATECORE_API FSlateDebuggingFocusEventArgs(ESlateDebuggingFocusEvent InFocusEventType, const FFocusEvent &InFocusEvent, const FWeakWidgetPath &InOldFocusedWidgetPath, const TSharedPtr< SWidget > &InOldFocusedWidget, const FWidgetPath &InNewFocusedWidgetPath, const TSharedPtr< SWidget > &InNewFocusedWidget)
ESlateDebuggingFocusEvent FocusEventType
Definition SlateDebugging.h:160
Definition SlateDebugging.h:92
const ESlateDebuggingInputEvent InputEventType
Definition SlateDebugging.h:96
SLATECORE_API FSlateDebuggingInputEventArgs(ESlateDebuggingInputEvent InInputEventType, const FInputEvent *InInputEvent, const FReply &InReply, const TSharedPtr< SWidget > &InHandlerWidget, const FString &InAdditionalContent)
const TSharedPtr< SWidget > & HandlerWidget
Definition SlateDebugging.h:99
const FString & AdditionalContent
Definition SlateDebugging.h:100
const FReply & Reply
Definition SlateDebugging.h:98
const FInputEvent * InputEvent
Definition SlateDebugging.h:97
SLATECORE_API FText ToText() const
Definition SlateDebugging.h:242
const SWidget * WidgetInvalidateInvestigator
Definition SlateDebugging.h:254
EInvalidateWidgetReason InvalidateWidgetReason
Definition SlateDebugging.h:255
ESlateDebuggingInvalidateRootReason InvalidateInvalidationRootReason
Definition SlateDebugging.h:256
SLATECORE_API FSlateDebuggingInvalidateArgs(const SWidget *WidgetInvalidated, const SWidget *WidgetInvalidateInvestigator, ESlateDebuggingInvalidateRootReason InvalidateReason)
SLATECORE_API FSlateDebuggingInvalidateArgs(const SWidget *WidgetInvalidated, const SWidget *WidgetInvalidateInvestigator, EInvalidateWidgetReason InvalidateReason)
const SWidget * WidgetInvalidated
Definition SlateDebugging.h:253
Definition SlateDebugging.h:210
SLATECORE_API FText ToText() const
uint32 UserIndex
Definition SlateDebugging.h:220
SLATECORE_API FSlateDebuggingMouseCaptureEventArgs(bool InCaptured, uint32 InUserIndex, uint32 InPointerIndex, const TSharedPtr< const SWidget > &InCapturingWidget)
uint32 PointerIndex
Definition SlateDebugging.h:221
const TSharedPtr< const SWidget > & CaptureWidget
Definition SlateDebugging.h:222
bool Captured
Definition SlateDebugging.h:219
Definition SlateDebugging.h:171
SLATECORE_API FSlateDebuggingNavigationEventArgs(const FNavigationEvent &InNavigationEvent, const FNavigationReply &InNavigationReply, const FWidgetPath &InNavigationSource, const TSharedPtr< SWidget > &InDestinationWidget, const ESlateDebuggingNavigationMethod InNavigationMethod)
const FNavigationEvent & NavigationEvent
Definition SlateDebugging.h:181
const FNavigationReply & NavigationReply
Definition SlateDebugging.h:182
const ESlateDebuggingNavigationMethod NavigationMethod
Definition SlateDebugging.h:185
const TSharedPtr< SWidget > & DestinationWidget
Definition SlateDebugging.h:184
const FWidgetPath & NavigationSource
Definition SlateDebugging.h:183
SLATECORE_API FText ToText() const
Definition SlateDebugging.h:196
const TSharedPtr< SWidget > & OptionalContextWidget
Definition SlateDebugging.h:204
SLATECORE_API FText ToText() const
const FText & Warning
Definition SlateDebugging.h:203
SLATECORE_API FSlateDebuggingWarningEventArgs(const FText &InWarning, const TSharedPtr< SWidget > &InOptionalContextWidget)
Definition SlateDebugging.h:260
const SWidget * Widget
Definition SlateDebugging.h:268
SLATECORE_API FSlateDebuggingWidgetUpdatedEventArgs(const SWidget *Widget, EWidgetUpdateFlags UpdateFlags, bool bFromPaint)
EWidgetUpdateFlags UpdateFlags
Definition SlateDebugging.h:270
SLATECORE_API FText ToText() const
bool bFromPaint
Definition SlateDebugging.h:272
Definition SlateDebugging.h:350
SLATECORE_API FScopeProcessInputEvent(ESlateDebuggingInputEvent InputEvent, const FInputEvent &Event)
ESlateDebuggingInputEvent InputEvent
Definition SlateDebugging.h:351
Definition SlateDebugging.h:358
SLATECORE_API FScopeRouteInputEvent(ESlateDebuggingInputEvent InputEvent, const FName &RoutingType)
ESlateDebuggingInputEvent InputEvent
Definition SlateDebugging.h:359
Definition SlateDebugging.h:369
virtual void OnProcessInput(ESlateDebuggingInputEvent InputEventType, const FInputEvent &Event)=0
virtual void OnInputProcessed(ESlateDebuggingInputEvent InputEventType)=0
virtual void OnInputEvent(ESlateDebuggingInputEvent InputEventType, const FReply &InReply, const TSharedPtr< SWidget > &HandlerWidget)=0
virtual void OnRouteInput(ESlateDebuggingInputEvent InputEventType, const FName &RoutedType)=0
virtual void OnPreProcessInput(ESlateDebuggingInputEvent InputEventType, const TCHAR *InputPrecessorName, bool bHandled)=0
virtual void OnInputRouted(ESlateDebuggingInputEvent InputEventType)=0