UWidget

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

Windows
MacOS
Linux

Inheritance Hierarchy

UObjectBase

UObjectBaseUtility

UObject

UVisual

UWidget

UCircularThrobber

UComboBox

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

UPanelWidget

UCanvasPanel

UCommonWidgetCarousel

UContentWidget

UBackgroundBlur

UBorder

UCommonBorder

UCommonVisibilityWidgetBase

UCommonCustomNavigation

UButton

UCommonButtonInternalBase

UCheckBox

UCommonLoadGuard

UInvalidationBox

UMenuAnchor

UNamedSlot

URetainerBox

USafeZone

UScaleBox

USizeBox

UCommonVisualAttachment

UViewport

UWindowTitleBarArea

UGridPanel

UHorizontalBox

UOverlay

UCommonVisibilitySwitcher

UScrollBox

UCommonHierarchicalScrollBox

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

UCommonButtonBase

UCommonBoundActionButton

UCommonRotator

UCommonTabListWidgetBase

UEditorUtilityWidget

ULevelSequenceBurnIn

UMoviePipelineBurnInWidget

UTakeRecorderOverlayWidget

UWebBrowser

References

Module

UMG

Header

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

Include

#include "Components/Widget.h"

Syntax

class UWidget : public UVisual

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

uint8: 1

 

bIsEnabled

Sets whether this widget can be modified interactively by the user

Public variable

FGetBool

 

bIsEnabledDelegate

A bindable delegate for bIsEnabled

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:

Public variable

EWidgetClipping

 

Clipping

Controls how the clipping behavior of this widget.

Public variable

TEnumAsByte< EM...

 

Cursor

The cursor to show when the mouse is over the widget

Public variable

EFlowDirectionP...

 

FlowDirectionPreference

Allows you to set a new flow direction

Protected variable

TWeakPtr< SObje...

 

MyGCWidget

The underlying SWidget contained in a SObjectWidget

Protected variable

TWeakPtr< SWidg...

 

MyWidget

The underlying SWidget.

Protected variable

TArray< UProper...

 

NativeBindings

Native property bindings.

Public variable

UWidgetNavigati...

 

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

float

 

RenderOpacity

The opacity of the widget

Public variable

FWidgetTransfor...

 

RenderTransform

A bindable delegate for Cursor The render transform of the widget allows for arbitrary 2D transforms to be applied to the widget.

Public variable

FVector2D

 

RenderTransformPivot

The render transform pivot controls the location about which transforms are applied.

Public variable

UPanelSlot *...

 

Slot

The parent slot of the UWidget.

Public variable

FText

 

ToolTipText

Tooltip text to show when the user hovers over the widget with the mouse

Public variable

FGetText

 

ToolTipTextDelegate

A bindable delegate for ToolTipText

Public variable

UWidget *

 

ToolTipWidget

Tooltip widget to show when the user hovers over the widget with the mouse

Public variable

FGetWidget

 

ToolTipWidgetDelegate

A bindable delegate for ToolTipWidget

Public variable

ESlateVisibilit...

 

Visibility

The visibility of the widget

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...
)

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

 

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 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

TGameInstanc...

 

GetGameInstance()

Gets the game instance associated with this UI.

Public function Const

UGameInstanc...

 

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 Virtual Const

APlayerContr...

 

GetOwningPlayer()

Gets the player controller associated with this UI.

Public function Const

TPlayerContr...

 

GetOwningPlayer()

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

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

float

 

GetRenderTransformAngle()

Protected function Const

UObject *...

 

GetSourceAssetOrClass()

Public function Const

const FGeome...

 

GetTickSpaceGeometry()

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()

Begin UObject.

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.

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

 

IsLockedInDesigner()

Is this widget locked in the designer UI

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 Virtual

void

 

OnBeginEditByDesigner()

Protected function Virtual

void

 

OnBindingChanged

(
    const FName& Property
)

Public function Virtual

void

 

OnCreationFromPalette()

Called by the palette after constructing a new widget, allows the widget to perform interesting default setup that we don't want to be UObject Defaults.

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

 

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

 

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

 

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

(
    const ITargetPlatform* TargetP...
)

Presave function.

Classes

Typedefs

Name

Description

ConstructMethodType

Constants

Name

Description

BinderClasses

Deprecated Functions

Name Description

Protected function

TSharedRef< ...

 

BuildDesignTimeWidget

(
    TSharedRef< SWidget > WrapWidget
)

Don't call this function in RebuildWidget any more. Override RebuildDesignWidget, and build the wrapper there; widgets that derive from Panel already do this. If you need to recreate the dashed outline you can use CreateDesignerOutline inside RebuildDesignWidget.

Public function Virtual

const FSlate...

 

GetEditorIcon()

GetEditorIcon is deprecated. Please define widget icons in your style set in the form ClassIcon.MyWidget, and register your style through FClassIconFinder::(Un)RegisterIconSource

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
Dismiss