FWidgetGenerator

A WidgetGenerator is a component responsible for creating widgets from data items.

Windows
MacOS
Linux

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/Views/SListView.h

Include

#include "Widgets/Views/SListView.h"

Syntax

class FWidgetGenerator

Remarks

A WidgetGenerator is a component responsible for creating widgets from data items. It also provides mapping from currently generated widgets to the data items which they represent.

Variables

Name Description

Public variable

TArray< ItemTyp...

 

ItemsToBeCleanedUp

Items that need their widgets destroyed because they are no longer on screen.

Public variable

TArray< ItemTyp...

 

ItemsWithGeneratedWidgets

A set of Items that currently have a generated widget

Public variable

TMap< ItemType,...

 

ItemToWidgetMap

Map of DataItems to corresponding SWidgets

Public variable

SListView< Item...

 

OwnerList

We store a pointer to the owner list for error purposes, so when asserts occur we can report which list it happened for.

Public variable

int32

 

TotalItemsLastGeneration

Total number of DataItems the last time we performed a generation pass.

Public variable

TMap< const ITa...

 

WidgetMapToItem

Map of SWidgets to DataItems from which they were generated

Constructors

Name Description

Public function

FWidgetGenerator

(
    SListView< ItemType >* InOwner...
)

Functions

Name Description

Public function

void

 

Clear()

Clear everything so widgets will be regenerated

Public function Const

TSharedPtr< ...

 

GetWidgetForItem

(
    const ItemType& Item
)

Find a widget for this item if it has already been constructed.

Public function

void

 

OnBeginGenerationPass()

Called at the beginning of the generation pass.

Public function

void

 

OnEndGenerationPass()

Called at the end of the generation pass.

Public function

void

 

OnItemSeen

(
    ItemType InItem,
    TSharedRef< ITableRow > InGenerated...
)

Keep track of every item and corresponding widget during a generation pass.

Public function

void

 

ProcessItemCleanUp()

Public function

void

 

ValidateWidgetGeneration()

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