SWeakWidget

Implements a widget that holds a weak pointer to one child widget.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/SWeakWidget.h

Include

#include "Widgets/SWeakWidget.h"

Syntax

class SWeakWidget : public SWidget

Remarks

Implements a widget that holds a weak pointer to one child widget.

Weak widgets encapsulate a piece of content without owning it. e.g. A tooltip is owned by the hovered widget but displayed by a floating window. That window cannot own the tooltip and must therefore use an SWeakWidget.

Constructors

Name Description

Public function

SWeakWidget()

Functions

Name Description

Public function Const

bool

 

ChildWidgetIsValid()

Public function

void

 

Construct

(
    const FArguments& InArgs
)

Public function Const

TWeakPtr< SW...

 

GetChildWidget()

Public function

void

 

SetContent

(
    const TSharedRef< SWidget >& InWid...
)

Overridden from SWidget

Name Description

Protected function Virtual Const

FVector2D

 

ComputeDesiredSize

(
    float LayoutScaleMultiplier
)

Compute the ideal size necessary to display this widget.

Public function Virtual

FChildren &#...

 

GetChildren()

Every widget that has children must implement this method.

Public function Virtual Const

void

 

OnArrangeChildren

(
    const FGeometry& AllottedGeometry,
    FArrangedChildren& ArrangedChildre...
)

Compute the Geometry of all the children and add populate the ArrangedChildren list with their values.

Public function Virtual Const

int32

 

OnPaint

(
    const FPaintArgs& Args,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 LayerId,
    const FWidgetStyle& InWidgetStyle,
    bool bParentEnabled
)

The widget should respond by populating the OutDrawElements array with FDrawElements that represent it and any of its children.

Classes

Name

Description

Public struct

FArguments

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