UListView

A virtualized list that allows up to thousands of items to be displayed.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

UMG

Header

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

Include

#include "Components/ListView.h"

Syntax

class UListView :
    public UListViewBase,
    public ITypedUMGListView< UObject * >

Remarks

A virtualized list that allows up to thousands of items to be displayed.

An important distinction to keep in mind here is "Item" vs. "Entry" The list itself is based on a list of n items, but only creates as many entry widgets as can fit on screen. For example, a scrolling ListView of 200 items with 5 currently visible will only have created 5 entry widgets.

To make a widget usable as an entry in a ListView, it must inherit from the IUserObjectListEntry interface.

Variables

Name Description

Protected variable

bool

 

bClearSelectionOnClick

Protected variable

bool

 

bIsFocusable

Protected variable

bool

 

bReturnFocusToSelection

Protected variable

EConsumeMouseWh...

 

ConsumeMouseWheel

Protected variable

float

 

EntrySpacing

Protected variable

TArray< UObject...

 

ListItems

Protected variable

TSharedPtr< SLi...

 

MyListView

Protected variable

TEnumAsByte< EO...

 

Orientation

The scroll & layout orientation of the list.

Protected variable

TEnumAsByte< ES...

 

SelectionMode

Constructors

Name Description

Public function

UListView

(
    const FObjectInitializer& Initiali...
)

Functions

Name Description

Public function

void

 

AddItem

(
    UObject* Item
)

Adds an the item to the list

Public function

void

 

ClearListItems()

Removes all items from the list

Protected function

TSharedRef< ...

 

ConstructListView()

SListView construction helper - useful if using a custom STreeView subclass

Public function Const

RowWidgetT &...

 

GetEntryWidgetFromItem

(
    const UObject* Item
)

Public function Const

int32

 

GetIndexForItem

(
    UObject* Item
)

Returns the index that the specified item is at. Will return the first found, or -1 for not found

Public function Const

UObject *...

 

GetItemAt

(
    int32 Index
)

Returns the item at the given index

Public function Const

const TArray...

 

GetListItems()

Gets the list of all items in the list.

Public function Const

int32

 

GetNumItems()

Returns the total number of items

Public function Const

EOrientation

 

GetOrientation()

Public function Const

ObjectT *...

 

GetSelectedItem()

Gets the first selected item, if any; recommended that you only use this for single selection lists.

Public function Const

ESelectionMo...

 

GetSelectionMode()

Protected function

void

 

HandleOnEntryInitializedInternal

(
    UObject* Item,
    const TSharedRef< ITableRow >& Tab...
)

Public function Const

bool

 

IsRefreshPending()

Returns true if a refresh is pending and the list will be rebuilt on the next tick

Public function

void

 

NavigateToIndex

(
    int32 Index
)

Requests that the item at the given index navigated to, scrolling it into view if needed.

Protected function Virtual

void

 

OnItemsChanged

(
    const TArray< UObject* >& Add...,
    const TArray< UObject* >& Rem...
)

Protected function Virtual

void

 

OnSelectionChangedInternal

(
    UObject* FirstSelectedItem
)

Public function

void

 

RemoveItem

(
    UObject* Item
)

Removes an the item from the list

Public function

void

 

ScrollIndexIntoView

(
    int32 Index
)

Requests that the item at the given index is scrolled into view

Public function

void

 

SetListItems

(
    const TArray< ItemObjectT, Allocato...
)

Set the list of items to display within this listview

Public function

void

 

SetSelectedIndex

(
    int32 Index
)

Sets the item at the given index as the sole selected item.

Public function

void

 

SetSelectedItem

(
    const UObject* Item
)

Public function

void

 

SetSelectionMode

Sets the new selection mode, preserving the current selection where possible.

Overridden from UListViewBase

Name Description

Protected function Virtual

void

 

HandleListEntryHovered

(
    UUserWidget& EntryWidget
)

Protected function Virtual

void

 

HandleListEntryUnhovered

(
    UUserWidget& EntryWidget
)

Protected function Virtual

void

 

OnRefreshDesignerItems()

Called during design time to allow lists to generate preview entries via dummy data.

Protected function Virtual

TSharedRef< ...

 

RebuildListWidget()

Implement in child classes to construct the actual ListView Slate widget

Overridden from UVisual

Name Description

Public function Virtual

void

 

ReleaseSlateResources

(
    bool bReleaseChildren
)

Overridden from ITypedUMGListView

Name Description

Public function Virtual Const

TSubclassOf<...

 

GetDefaultEntryClass()

Protected function Virtual Const

FMargin

 

GetDesiredEntryPadding

(
    UObject* Item
)

Gets the desired padding for the entry representing the given item

Protected function Virtual Const

SListView< U...

 

GetMyListView()

Protected function Virtual Const

uint32

 

GetOwningUserIndex()

Protected function Virtual Const

bool

 

IsDesignerPreview()

Protected function Virtual

UUserWidget ...

 

OnGenerateEntryWidgetInternal

(
    UObject* Item,
    TSubclassOf< UUserWidget > DesiredE...,
    const TSharedRef< STableViewBase > ...
)

Generates the actual entry widget that represents the given item.

Public function Virtual Const

FOnGetEntryC...

 

OnGetEntryClassForItem()

Public function Virtual Const

FSimpleListI...

 

OnItemClicked()

Protected function Virtual

void

 

OnItemClickedInternal

(
    UObject* Item
)

ListView events - implement these instead of binding handlers directly to a list

Public function Virtual Const

FSimpleListI...

 

OnItemDoubleClicked()

Protected function Virtual

void

 

OnItemDoubleClickedInternal

(
    UObject* Item
)

Public function Virtual Const

FOnItemExpan...

 

OnItemExpansionChanged()

Public function Virtual Const

FOnItemIsHov...

 

OnItemIsHoveredChanged()

Public function Virtual Const

FOnItemScrol...

 

OnItemScrolledIntoView()

Protected function Virtual

void

 

OnItemScrolledIntoViewInternal

(
    UObject* Item,
    UUserWidget& EntryWidget
)

Public function Virtual Const

FOnItemSelec...

 

OnItemSelectionChanged()

Public function Virtual Const

FOnListViewS...

 

OnListViewScrolled()

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