UWidget

This is the base class for all wrapped Slate controls that are exposed to UObjects.

Inheritance Hierarchy

UObjectBase

UObjectBaseUtility

UObject

UVisual

UWidget

UAudioMeter

UAudioRadialSlider

UAudioFrequencyRadialSlider

UAudioVolumeRadialSlider

UAudioSliderBase

UAudioFrequencySlider

UAudioSlider

UAudioVolumeSlider

UCircularThrobber

UComboBox

UComboBoxKey

UComboBoxString

UCommonActionWidget

UCommonActivatableWidgetContainerBase

UCommonActivatableWidgetQueue

UCommonActivatableWidgetStack

UCommonLazyWidget

UCommonVideoPlayer

UCommonWidgetCarouselNavBar

UDynamicEntryBoxBase

UCommonBoundActionBar

UDynamicEntryBox

UEditableText

UEditableTextBox

UExpandableArea

UImage

UCommonLazyImage

UInputKeySelector

UListViewBase

UListView

UCommonListView

UTileView

UCommonTileView

UTreeView

UCommonTreeView

UNativeWidgetHost

UObjectMixerEditorUWidget

UPanelWidget

UCanvasPanel

UCommonWidgetCarousel

UContentWidget

UBackgroundBlur

UBorder

UCommonBorder

UCommonHardwareVisibilityBorder

UDEPRECATED_UCommonVisibilityWidgetBase

UCommonCustomNavigation

UButton

UCommonButtonInternalBase

UCheckBox

UCommonLoadGuard

UInvalidationBox

UMenuAnchor

UNamedSlot

URetainerBox

USafeZone

UScaleBox

USizeBox

UCommonVisualAttachment

UViewport

UWindowTitleBarArea

UGridPanel

UHorizontalBox

UOverlay

UCommonVisibilitySwitcher

UScrollBox

UCommonHierarchicalScrollBox

UStackBox

UUniformGridPanel

UVerticalBox

UWidgetSwitcher

UCommonAnimatedSwitcher

UCommonActivatableWidgetSwitcher

UWrapBox

UProgressBar

UPropertyViewBase

UDetailsView

USinglePropertyView

URadialSlider

UScrollBar

USlider

UAnalogSlider

USpacer

USpinBox

USynth2DSlider

USynthKnob

UTextLayoutWidget

UMultiLineEditableText

UMultiLineEditableTextBox

URichTextBlock

UCommonRichTextBlock

UTextBlock

UCommonTextBlock

UCommonDateTimeTextBlock

UCommonNumericTextBlock

UThrobber

UUserWidget

UCommonUserWidget

UCommonActivatableWidget

UXRCreativePaletteTab

UXRCreativePaletteToolTab

UCommonButtonBase

UCommonBoundActionButton

UCommonRotator

UCommonTabListWidgetBase

UXRCreativePalette

UDGGUI

UEditorUtilityWidget

ULevelSequenceBurnIn

UMoviePipelineBurnInWidget

UMovieRenderDebugWidget

UTakeRecorderOverlayWidget

UUTBCommandUMGUI

UVCamWidget

UVCamStateSwitcherWidget

UWebBrowser

References

Module

UMG

Header

/Engine/Source/Runtime/UMG/Public/Components/Widget.h

Include

#include "Components/Widget.h"

Syntax

class UWidget :
    public UVisual,
    public INotifyFieldValueChanged

Remarks

This is the base class for all wrapped Slate controls that are exposed to UObjects.

Variables

Name Description

Public variable

ESlateAccessibl...

 

AccessibleBehavior

Whether or not the widget is accessible, and how to describe it.

Public variable

ESlateAccessibl...

 

AccessibleSummaryBehavior

How to describe this widget when it's being presented through a summary of a parent widget.

Public variable

FText

 

AccessibleSummaryText

When AccessibleSummaryBehavior is set to Custom, this is the text that will be used to describe the widget.

Public variable

USlateAccessibl...

 

AccessibleSummaryTextDelegate

An optional delegate that may be assigned in place of AccessibleSummaryText for creating a TAttribute

Public variable

FText

 

AccessibleText

When AccessibleBehavior is set to Custom, this is the text that will be used to describe the widget.

Public variable

USlateAccessibl...

 

AccessibleTextDelegate

An optional delegate that may be assigned in place of AccessibleText for creating a TAttribute

Public variable

uint8: 1

 

bCanChildrenBeAccessible

Whether or not children of this widget can appear as distinct accessible widgets.

Public variable

uint8: 1

 

bCreatedByConstructionScript

Flag if the Widget was created from a blueprint

Public variable

uint8: 1

 

bExpandedInDesigner

Stores the design time flag setting if the widget is expanded inside the designer

Public variable

uint8: 1

 

bHiddenInDesigner

Stores the design time flag setting if the widget is hidden inside the designer

Public variable

FGetBool

 

bIsEnabledDelegate

A bindable delegate for bIsEnabled

Protected variable

uint8: 1

 

bIsManagedByGameViewportSubsystem

Cached value that indicate if the widget was added to the GameViewportSubsystem.

Public variable

uint8: 1

 

bIsVariable

Allows controls to be exposed as variables in a blueprint.

Protected variable

uint8: 1

 

bIsVolatile

If true prevents the widget or its child's geometry or layout information from being cached.

Public variable

uint8: 1

 

bLockedInDesigner

Stores the design time flag setting if the widget is locked inside the designer

Public variable

uint8: 1

 

bOverride_Cursor

Public variable

uint8: 1

 

bOverrideAccessibleDefaults

These editor-only properties exist for two reasons:

Protected variable

TWeakPtr< SObje...

 

MyGCWidget

The underlying SWidget contained in a SObjectWidget

Protected variable

TWeakPtr< SWidg...

 

MyWidget

The underlying SWidget.

Protected variable

TArray< TObject...

 

NativeBindings

Native property bindings.

Public variable

TObjectPtr< cla...

 

Navigation

The navigation object for this widget is optionally created if the user has configured custom navigation rules for this widget in the widget designer.

Public variable

TObjectPtr< UPa...

 

Slot

The parent slot of the UWidget.

Public variable

FGetText

 

ToolTipTextDelegate

A bindable delegate for ToolTipText

Public variable

FGetWidget

 

ToolTipWidgetDelegate

A bindable delegate for ToolTipWidget

Public variable

friend

 

UGameViewportSubsystem

Public variable

FGetSlateVisibi...

 

VisibilityDelegate

A bindable delegate for Visibility

Public variable

TWeakObjectPtr<...

 

WidgetGeneratedBy

Stores a reference to the asset responsible for this widgets construction.

Public variable

TWeakObjectPtr<...

 

WidgetGeneratedByClass

Stores a reference to the class responsible for this widgets construction.

Constructors

Name Description

Public function

UWidget

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

bool

 

AddBinding

(
    FDelegateProperty* DelegatePro...,
    UObject* SourceObject,
    const FDynamicPropertyPath& Bindin...
)

Protected function

void

 

BroadcastFieldValueChanged

Public function

void

 

BuildNavigation()

Called by the owning user widget after the slate widget has been created.

Protected function

bool

 

CanSafelyRouteCall()

Public function

bool

 

CanSafelyRouteEvent()

Public function

bool

 

CanSafelyRoutePaint()

Public function Virtual

void

 

ConnectEditorData()

Allows general fixups and connections only used at editor time.

Protected function Const

TOptional< f...

 

ConvertFloatToOptionalFloat

(
    TAttribute< float > InFloat
)

Protected function Const

FSlateColor

 

ConvertLinearColorToSlateColor

(
    TAttribute< FLinearColor > InLinear...
)

Public function Static

ESlateVisibi...

 

ConvertRuntimeToSerializedVisibility

(
    const EVisibility& Input
)

Public function Static

FSizeParam

 

ConvertSerializedSizeParamToRuntime

(
    const FSlateChildSize& Input
)

Public function Static

EVisibility

 

ConvertSerializedVisibilityToRuntime

(
    ESlateVisibility Input
)

End Designer contextual events.

Protected function Const

EVisibility

 

ConvertVisibility

(
    TAttribute< ESlateVisibility > Seri...
)

TODO UMG Consider moving conversion functions into another class. Conversion functions

Protected function Const

TSharedRef< ...

 

CreateDesignerOutline

(
    TSharedRef< SWidget > Content
)

Public function

void

 

CreatedFromPalette()

Called by the palette after constructing a new widget.

Public function

void

 

DeselectByDesigner()

Public function Static

TSubclassOf<...

 

FindBinderClassForDestination

(
    FProperty* Property
)

Public function Static

UWidget *...

 

FindChildContainingDescendant

(
    UWidget* Root,
    UWidget* Descendant
)

Public function

void

 

ForceLayoutPrepass()

Forces a pre-pass.

Public function

void

 

ForceVolatile

(
    bool bForce
)

Sets the forced volatility of the widget.

Public function Const

FText

 

GetAccessibleSummaryText()

Gets the accessible summary text from the underlying Slate accessible widget.

Public function Const

FText

 

GetAccessibleText()

Gets the accessible text from the underlying Slate accessible widget

Protected function Virtual Const

TSharedPtr< ...

 

GetAccessibleWidget()

Gets the widget that accessibility properties should synchronize to.

Public function Const

const FGeome...

 

GetCachedGeometry()

Gets the last geometry used to Tick the widget.

Public function Const

TSharedPtr< ...

 

GetCachedWidget()

Gets the last created widget does not recreate the gc container for the widget if one is needed.

Public function Const

const FStrin...

 

GetCategoryName()

Returns the category name of the widget

Public function Const

EWidgetClipp...

 

GetClipping()

Gets the clipping state of this widget.

Public function Const

EMouseCursor...

 

GetCursor()

Sets the cursor to show over the widget.

Public function Static

FString

 

GetDefaultFontName()

Public function Const

EWidgetDesig...

 

GetDesignerFlags()

Gets the designer flags currently set on the widget.

Public function Const

FVector2D

 

GetDesiredSize()

Gets the widgets desired size.

Public function Const

const FStrin...

 

GetDisplayLabel()

Returns the friendly name of the widget to display in the editor

Protected function Const

FText

 

GetDisplayNameBase()

Gets the base name used to generate the display label/name of this widget.

Public function Const

EFlowDirecti...

 

GetFlowDirectionPreference()

Gets the flow direction preference of the widget

Public function Const

UGameInstanc...

 

GetGameInstance()

Gets the game instance associated with this UI.

Public function Const

TGameInstanc...

 

GetGameInstance()

Gets the game instance associated with this UI.

Public function Const

bool

 

GetIsEnabled()

Gets the current enabled status of the widget

Public function Virtual Const

FString

 

GetLabelMetadata()

Get Label Metadata, which may be as simple as a bit of string data to help identify an anonymous text block.

Public function Const

FText

 

GetLabelText()

Gets the label to display to the user for this widget.

Public function Const

FText

 

GetLabelTextWithMetadata()

Gets the label to display to the user for this widget, including any extra metadata like the text string for text.

Public function Const

T *

 

GetOwningLocalPlayer()

Gets the local player associated with this UI cast to the template type.

Public function Virtual Const

ULocalPlayer...

 

GetOwningLocalPlayer()

Gets the local player associated with this UI.

Public function Const

TPlayerContr...

 

GetOwningPlayer()

Gets the player controller associated with this UI cast to the template type.

Public function Virtual Const

APlayerContr...

 

GetOwningPlayer()

Gets the player controller associated with this UI.

Public function Const

const FGeome...

 

GetPaintSpaceGeometry()

Public function Virtual

const FText

 

GetPaletteCategory()

Gets the palette category of the widget

Public function Const

UPanelWidget...

 

GetParent()

Gets the parent widget

Public function Const

float

 

GetRenderOpacity()

Gets the current visibility of the widget.

Public function Const

const FWidge...

 

GetRenderTransform()

Public function Const

float

 

GetRenderTransformAngle()

Public function Const

FVector2D

 

GetRenderTransformPivot()

Protected function Const

UObject *...

 

GetSourceAssetOrClass()

Public function Const

const FGeome...

 

GetTickSpaceGeometry()

Public function Const

UWidget *...

 

GetToolTip()

Public function Const

FText

 

GetToolTipText()

Public function Const

ESlateVisibi...

 

GetVisibility()

Gets the current visibility of the widget.

Protected function Const

EVisibility

 

GetVisibilityInDesigner()

This is an implementation detail that allows us to show and hide the widget in the designer regardless of the actual visibility state set by the user.

Public function Virtual Const

UWorld *

 

GetWorld()

Public function Const

bool

 

HasAnyDesignerFlags

(
    EWidgetDesignFlags FlagsToCheck
)

Tests if any of the flags exist on this widget.

Public function Const

bool

 

HasAnyUserFocus()

Returns true if this widget is focused by any user.

Public function Const

bool

 

HasFocusedDescendants()

Returns true if any descendant widget is focused by any user.

Public function Const

bool

 

HasKeyboardFocus()

Checks to see if this widget currently has the keyboard focus

Public function Const

bool

 

HasMouseCapture()

Checks to see if this widget is the current mouse captor

Public function Const

bool

 

HasMouseCaptureByUser

(
    int32 UserIndex,
    int32 PointerIndex
)

Checks to see if this widget is the current mouse captor

Public function Const

bool

 

HasUserFocus

(
    APlayerController* PlayerContr...
)

Returns true if this widget is focused by a specific user.

Public function Const

bool

 

HasUserFocusedDescendants

(
    APlayerController* PlayerContr...
)

Returns true if any descendant widget is focused by a specific user.

Public function

void

 

InvalidateLayoutAndVolatility()

Invalidates the widget from the view of a layout caching widget that may own this widget.

Public function

bool

 

IsChildOf

(
    UWidget* PossibleParent
)

Recurses up the list of parents and returns true if this widget is a descendant of the PossibleParent

Public function Const

bool

 

IsConstructed()

Gets the last created widget does not recreate the gc container for the widget if one is needed.

Public function Const

bool

 

IsDesignTime()

Returns if the widget is currently being displayed in the designer, it may want to display different data.

Protected function Const

bool

 

IsEditorWidget()

Public function Const

bool

 

IsGeneratedName()

Is the label generated or provided by the user?

Public function Virtual Const

bool

 

IsHovered()

Returns true if the widget is currently being hovered by a pointer device

Public function Const

bool

 

IsInViewport()

Public function Const

bool

 

IsLockedInDesigner()

Is this widget locked in the designer UI

Public function Const

bool

 

IsPreviewTime()

Public function Const

bool

 

IsRendered()

Returns true if the widget is Visible, HitTestInvisible or SelfHitTestInvisible and the Render Opacity is greater than 0.

Public function Const

bool

 

IsVisible()

Returns true if the widget is Visible, HitTestInvisible or SelfHitTestInvisible.

Public function Const

bool

 

IsVisibleInDesigner()

Is the widget visible in the designer? If this widget is 'hidden in the designer' or a parent is, this widget will also return false here.

Public function

void

 

K2_AddFieldValueChangedDelegate

Protected function

void

 

K2_BroadcastFieldValueChanged

(
    FFieldNotificationId FieldId
)

Public function

void

 

K2_RemoveFieldValueChangedDelegate

Public function Virtual

void

 

OnBeginEditByDesigner()

Protected function Virtual

void

 

OnBindingChanged

(
    const FName& Property
)

Public function Virtual

void

 

OnCreationFromPalette()

Called after constructing a new widget from the palette.

Public function Virtual

void

 

OnDescendantDeselectedByDesigner

(
    UWidget* DescendantWidget
)

Public function Virtual

void

 

OnDescendantSelectedByDesigner

(
    UWidget* DescendantWidget
)

Public function Virtual

void

 

OnDeselectedByDesigner()

Public function Virtual

void

 

OnDesignerChanged

(
    const FDesignerChangedEventArgs& E...
)

Public function Virtual

void

 

OnEndEditByDesigner()

Public function Virtual

void

 

OnSelectedByDesigner()

Protected function Virtual

void

 

OnWidgetRebuilt()

Function called after the underlying SWidget is constructed.

Protected function Virtual

TSharedRef< ...

 

RebuildDesignWidget

(
    TSharedRef< SWidget > Content
)

Protected function Virtual

TSharedRef< ...

 

RebuildWidget()

Function implemented by all subclasses of UWidget is called when the underlying SWidget needs to be constructed.

Public function Virtual

void

 

RemoveFromParent()

Removes the widget from its parent widget.

Public function

void

 

ResetCursor()

Resets the cursor to use on the widget, removing any customization for it.

Public function

void

 

SelectByDesigner()

Begin Designer contextual events.

Public function

void

 

SetAllNavigationRules

(
    EUINavigationRule Rule,
    FName WidgetToFocus
)

Sets the widget navigation rules for all directions.

Public function

void

 

SetCategoryName

(
    const FString& InValue
)

Sets the category name of the widget

Public function

void

 

SetClipping

(
    EWidgetClipping InClipping
)

Sets the clipping state of this widget.

Public function

void

 

SetCursor

(
    EMouseCursor::Type InCursor
)

Sets the cursor to show over the widget.

Public function Virtual

void

 

SetDesignerFlags

(
    EWidgetDesignFlags NewFlags
)

Sets the designer flags on the widget.

Public function

void

 

SetDisplayLabel

(
    const FString& DisplayLabel
)

Sets the friendly name of the widget to display in the editor

Public function

void

 

SetFlowDirectionPreference

(
    EFlowDirectionPreference FlowDirect...
)

Sets the flow direction preference of the widget

Public function

void

 

SetFocus()

Sets the focus to this widget for the owning user

Public function Virtual

void

 

SetIsEnabled

(
    bool bInIsEnabled
)

Sets the current enabled status of the widget

Public function

void

 

SetKeyboardFocus()

Sets the focus to this widget.

Public function Virtual

void

 

SetLockedInDesigner

(
    bool NewLockedInDesigner
)

Public function

void

 

SetNavigationRuleBase

(
    EUINavigation Direction,
    EUINavigationRule Rule
)

Sets the widget navigation rules for a specific direction.

Public function

void

 

SetNavigationRuleCustom

(
    EUINavigation Direction,
    FCustomWidgetNavigationDelegate InC...
)

Sets the widget navigation rules for a specific direction.

Public function

void

 

SetNavigationRuleCustomBoundary

(
    EUINavigation Direction,
    FCustomWidgetNavigationDelegate InC...
)

Sets the widget navigation rules for a specific direction.

Public function

void

 

SetNavigationRuleExplicit

(
    EUINavigation Direction,
    UWidget* InWidget
)

Sets the widget navigation rules for a specific direction.

Protected function

void

 

SetNavigationRuleInternal

(
    EUINavigation Direction,
    EUINavigationRule Rule,
    FName WidgetToFocus,
    UWidget* InWidget,
    FCustomWidgetNavigationDelegate InC...
)

Public function

void

 

SetRenderOpacity

(
    float InOpacity
)

Sets the visibility of the widget.

Public function

void

 

SetRenderScale

(
    FVector2D Scale
)

Public function

void

 

SetRenderShear

(
    FVector2D Shear
)

Public function

void

 

SetRenderTransform

(
    FWidgetTransform InTransform
)

Public function

void

 

SetRenderTransformAngle

(
    float Angle
)

Public function

void

 

SetRenderTransformPivot

(
    FVector2D Pivot
)

Public function

void

 

SetRenderTranslation

(
    FVector2D Translation
)

Public function

void

 

SetToolTip

(
    UWidget* Widget
)

Sets a custom widget as the tooltip of the widget.

Public function

void

 

SetToolTipText

(
    const FText& InToolTipText
)

Sets the tooltip text for the widget.

Public function

void

 

SetUserFocus

(
    APlayerController* PlayerContr...
)

Sets the focus to this widget for a specific user (if setting focus for the owning user, prefer SetFocus())

Public function Virtual

void

 

SetVisibility

(
    ESlateVisibility InVisibility
)

Sets the visibility of the widget.

Protected function

void

 

SetVisibilityInternal

(
    ESlateVisibility InVisibility
)

Protected function

void

 

SynchronizeAccessibleData()

Copy all accessible properties to the AccessibleWidgetData object

Public function Virtual

void

 

SynchronizeProperties()

Applies all properties to the native widget if possible.

Public function

TSharedRef< ...

 

TakeDerivedWidget

(
    ConstructMethodType ConstructMethod
)

Public function

TSharedRef< ...

 

TakeWidget()

Gets the underlying slate widget or constructs it if it doesn't exist.

Protected function

void

 

UpdateRenderTransform()

Public function Virtual Const

void

 

ValidateCompiledDefaults

(
    IWidgetCompilerLog& CompileLog
)

Called at the end of Widget Blueprint compilation.

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

void

 

FinishDestroy()

Called to finish destroying the object.

Public function Virtual

bool

 

Modify

(
    bool bAlwaysMarkDirty
)

Mark this object as modified, also mark the slot as modified.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PreSave

(
    FObjectPreSaveContext SaveContext
)

Presave function.

Overridden from INotifyFieldValueChanged

Name Description

Public function Virtual

FDelegateHan...

 

AddFieldValueChangedDelegate

(
    UE::FieldNotification::FFieldId InF...,
    FFieldValueChangedDelegate InNewDel...
)

Add a delegate that will be notified when the FieldId is value changed.

Public function Virtual Const

const ::UE::...

 

GetFieldNotificationDescriptor()

Public function Virtual

int32

 

RemoveAllFieldValueChangedDelegates

(
    const void* InUserObject
)

Remove all the delegate that are bound to the specified UserObject.

Public function Virtual

int32

 

RemoveAllFieldValueChangedDelegates

(
    UE::FieldNotification::FFieldId InF...,
    const void* InUserObject
)

Remove all the delegate that are bound to the specified Field and UserObject.

Public function Virtual

bool

 

RemoveFieldValueChangedDelegate

(
    UE::FieldNotification::FFieldId InF...,
    FDelegateHandle InHandle
)

Remove a delegate that was added.

Classes

Typedefs

Name

Description

ConstructMethodType

Constants

Name

Description

BinderClasses

Deprecated Variables

Name Description

Public variable

uint8: 1

 

bIsEnabled

Direct access to bIsEnabled is deprecated. Please use the getter or setter.

Public variable

EWidgetClipping

 

Clipping

Direct access to Clipping is deprecated. Please use the getter or setter.

Public variable

TEnumAsByte< EM...

 

Cursor

Direct access to Cursor is deprecated. Please use the getter or setter.

Public variable

EFlowDirectionP...

 

FlowDirectionPreference

Direct access to FlowDirectionPreference is deprecated. Please use the getter or setter.

Public variable

float

 

RenderOpacity

Direct access to RenderOpacity is deprecated. Please use the getter or setter.

Public variable

FWidgetTransfor...

 

RenderTransform

Direct access to RenderTransform is deprecated. Please use the getter or setter.

Public variable

FVector2D

 

RenderTransformPivot

Direct access to RenderTransformPivot is deprecated. Please use the getter or setter.

Public variable

FText

 

ToolTipText

Direct access to ToolTipText is deprecated. Please use the getter or setter.

Public variable

TObjectPtr< UWi...

 

ToolTipWidget

Direct access to ToolTipWidget is deprecated. Please use the getter or setter.

Public variable

ESlateVisibilit...

 

Visibility

Direct access to Visibility is deprecated. Please use the getter or setter.

Deprecated Functions

Name Description

Public function

void

 

SetNavigationRule

(
    EUINavigation Direction,
    EUINavigationRule Rule,
    FName WidgetToFocus
)

SetNavigationRule is deprecated. Please use either SetNavigationRuleBase or SetNavigationRuleExplicit or SetNavigationRuleCustom or SetNavigationRuleCustomBoundary.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Cancel