Choose your operating system:
Windows
macOS
Linux
| STableViewBase |
| TListTypeTraits< ItemType >::SerializerType |
| ITypedTableView |
Module |
|
Header |
/Engine/Source/Runtime/Slate/Public/Widgets/Views/SListView.h |
Include |
#include "Widgets/Views/SListView.h" |
template<typename ItemType>
class SListView :
public STableViewBase,
private TListTypeTraits< ItemType >::SerializerType,
public ITypedTableView< ItemType >
A ListView widget observes an array of data items and creates visual representations of these items. ListView relies on the property that holding a reference to a value ensures its existence. In other words, neither SListView<FString> nor SListView<FString*> are valid, while SListView< TSharedPtr<FString> > and SListView< UObject* > are valid.
A trivial use case appear below:
Given: TArray< TSharedPtr<FString> > Items;
SNew( SListView< TSharedPtr<FString> > ) .ItemHeight(24) .ListItemsSource( &Items ) .OnGenerateRow( SListView< TSharedPtr<FString> >::MakeOnGenerateWidget( this, &MyClass::OnGenerateRowForList ) )
In the example we make all our widgets be 24 screen units tall. The ListView will create widgets based on data items in the Items TArray. When the ListView needs to generate an item, it will do so using the OnGenerateWidgetForList method.
A sample implementation of OnGenerateWidgetForList would simply return a TextBlock with the corresponding text:
TSharedRef<ITableRow> OnGenerateWidgetForList( TSharedPtr<FString> InItem, const TSharedRef<STableViewBase>& OwnerTable ) { return SNew(STextBlock).Text( (*InItem) ) }
Name | Description | ||
---|---|---|---|
|
bClearSelectionOnClick |
If true, the selection will be cleared if the user clicks in empty space (not on an item) |
|
|
bHandleDirectionalNavigation |
Should directional nav be supported |
|
|
bHandleGamepadEvents |
Should gamepad nav be supported |
|
|
bHandleSpacebarSelection |
Should space bar based selection be supported |
|
|
bNavigateOnScrollIntoView |
If true, the item currently slated to be scrolled into view will also be navigated to after being scrolled in |
|
|
bReturnFocusToSelection |
If true, the focus will be returned to the last selected object in a list when navigated to. |
|
|
HighlightedItems |
A set of which items should be highlighted |
|
|
TAttribute< boo... |
IsFocusable |
True when the list view supports keyboard focus |
|
const TArray< I... |
ItemsSource |
Pointer to the array of data items that we are observing |
|
ItemToNotifyWhenInView |
When set, the list will notify this item when it has been scrolled into view |
|
|
ItemToScrollIntoView |
When not null, the list will try to scroll to this item on tick. |
|
|
float |
NavigationScrollOffset |
The additional scroll offset (in items) to show when navigating to rows at the edge of the visible area (i.e. how much of the following item(s) to show) |
|
OnClick |
Called when the user clicks on an element int he list view with the left mouse button |
|
|
OnDoubleClick |
Called when the user double-clicks on an element in the list view with the left mouse button |
|
|
OnEnteredBadState |
Invoked when the tree enters a bad state. |
|
|
OnEntryInitialized |
Invoked after initializing an entry being generated, before it may be added to the actual widget hierarchy. |
|
|
OnGenerateRow |
Delegate to be invoked when the list needs to generate a new widget from a data item. |
|
|
OnIsSelectableOrNavigable |
Delegate to invoke to see if we can navigate or select item. |
|
|
OnItemScrolledIntoView |
Delegate to be invoked when an item has come into view after it was requested to come into view. |
|
|
OnItemToString_Debug |
Assign this to get more diagnostics from the list view. |
|
|
OnRowReleased |
||
|
OnSelectionChanged |
Delegate to invoke when selection changes. |
|
|
RangeSelectionStart |
The item which was last manipulated; used as a start for shift-click selection |
|
|
SelectedItems |
A set of selected data items |
|
|
SelectorItem |
The item to manipulate selection for |
|
|
const FTableVie... |
Style |
Style resource for the list |
|
UserRequestingScrollIntoView |
The user index requesting the item to be scrolled into view. |
|
|
FWidgetGenerato... |
WidgetGenerator |
A widget generator component |
Name | Description | |
---|---|---|
|
SListView ( |
Name | Description | ||
---|---|---|---|
|
AddReferencedObjects ( |
Lists and Trees serialize items that they observe because they rely on the property that holding a reference means it will not be garbage collected. |
|
|
CancelScrollIntoView() |
Cancels a previous request to scroll an item into view (cancels navigation requests as well). |
|
|
ClearHighlightedItems() |
Empty the highlighted item set. |
|
|
ClearSelection() |
Empty the selection set. |
|
|
Construct ( |
Construct this widget |
|
|
TSharedRef< ... |
GenerateNewWidget ( |
Given an data item, generate a widget corresponding to it. |
|
float |
GenerateWidgetForItem |
|
|
FOnItemToStr... |
GetDefaultDebugDelegate() |
|
|
GetMaxRowSizeForColumn ( |
Will determine the max row size for the specified column id |
|
|
GetNumItemsSelected() |
Gets the number of selected items. |
|
|
GetReferencerName() |
||
|
GetSelectedItems ( |
||
|
IsItemSelected ( |
Test if the current item is selected. |
|
|
IsItemVisible ( |
Checks whether the specified item is currently visible in the list view. |
|
|
const ItemTy... |
ItemFromWidget ( |
Given a Widget, find the corresponding data item. |
|
NavigationSelect ( |
Selects the specified item and scrolls it into view. If shift is held, it will be a range select. |
|
|
TOptional< I... |
Private_FindNextSelectableOrNavigable ( |
|
|
Private_OnEntryInitialized ( |
A low-level interface for use various widgets generated by ItemsWidgets(Lists, Trees, etc). |
|
|
RequestNavigateToItem ( |
Navigate to a specific item, scrolling it into view if needed. |
|
|
RequestScrollIntoView ( |
Scroll an item into view. If the item is not found, fails silently. |
|
|
SetItemHighlighted ( |
Set the highlighted state of an item. |
|
|
SetItemSelection ( |
Set the selection state of an item. |
|
|
SetItemSelection ( |
Set the selection state of multiple items. |
|
|
SetListItemsSource ( |
Establishes a wholly new list of items being observed by the list. |
|
|
SetOnEntryInitialized ( |
Sets the OnEntryInitializer delegate. |
|
|
SetSelection ( |
Set the currently selected Item. |
|
|
SetSelectionMode ( |
Set the current selection mode of the list. |
|
|
SetStyle ( |
Name | Description | ||
---|---|---|---|
|
GetNumItemsBeingObserved() |
||
|
NotifyItemScrolledIntoView() |
Called when an item has entered the visible geometry to check to see if the ItemScrolledIntoView delegate should be fired. |
|
|
RebuildList() |
Completely wipe existing widgets and fully regenerate them on next tick. |
|
|
FReGenerateR... |
ReGenerateItems ( |
Update generate Widgets for Items as needed and clean up any Widgets that are no longer needed. |
|
float |
ScrollBy ( |
Scroll the list view by some number of screen units. |
|
EScrollIntoV... |
ScrollIntoView ( |
If there is a pending request to scroll an item into view, do so. |
|
UpdateSelectionSet() |
Remove any items that are no longer in the list from the selection set. |
Name | Description | ||
---|---|---|---|
|
TSharedRef< ... |
CreateAccessibleWidget() |
|
|
GetDefaultAccessibleText ( |
Assign AccessibleText with a default value that can be used when AccessibleBehavior is set to Auto or Custom. |
|
|
OnKeyDown |
Called after a key is pressed when this widget has focus (this event bubbles if not handled) |
|
|
OnMouseButtonDown ( |
MOUSE INPUT The system calls this method to notify the widget that a mouse button was pressed within it. |
|
|
OnMouseButtonUp ( |
The system calls this method to notify the widget that a mouse button was release within it. |
|
|
FNavigationR... |
OnNavigation ( |
Called when navigation is requested e.g. Left Joystick, Direction Pad, Arrow Keys can generate navigation events. |
|
SupportsKeyboardFocus() |
Checks to see if this widget supports keyboard focus. Override this in derived classes. |
Name | Description | ||
---|---|---|---|
|
TSharedRef< ... |
AsWidget() |
|
|
TArray< Item... |
GetSelectedItems() |
Returns a list of selected item indices, or an empty array if nothing is selected |
|
ETableViewMo... |
GetTableViewMode() |
|
|
Private_ClearHighlightedItems() |
Empty the set of highlighted items. |
|
|
Private_ClearSelection() |
Empty the selection set. |
|
|
Private_DoesItemHaveChildren ( |
||
|
Private_GetNestingDepth ( |
||
|
Private_GetNumSelectedItems() |
||
|
Private_GetOrientation() |
||
|
ESelectionMo... |
Private_GetSelectionMode() |
|
|
const TBitAr... |
Private_GetWiresNeededByDepth ( |
|
|
Private_HasSelectorFocus ( |
Test if the item passed in has selector focus. |
|
|
Private_IsItemExpanded ( |
||
|
Private_IsItemHighlighted ( |
Test if the current item should be highlighted. This is separate from hover highlights. |
|
|
Private_IsItemSelectableOrNavigable ( |
Test if the current item can be selected or navigated to. |
|
|
Private_IsItemSelected ( |
Test if the current item is selected. |
|
|
Private_IsLastChild ( |
||
|
Private_IsPendingRefresh() |
Is the list pending a refresh? |
|
|
const ItemTy... |
Private_ItemFromWidget ( |
Given a Widget, find the corresponding data item. |
|
Private_OnExpanderArrowShiftClicked ( |
Called when the expander arrow for the given item is shift+clicked. |
|
|
Private_OnItemClicked ( |
Called when the item is clicked, and returns whether or not the event was handled |
|
|
Private_OnItemDoubleClicked ( |
Called when the item is double-clicked, and returns whether or not the event was handled |
|
|
Private_OnItemRightClicked ( |
Called when the item is right-clicked when not right mouse scrolling |
|
|
Private_SelectRangeFromCurrentTo ( |
Select a range of items from the current RangeSelectionStart to the SelectorItem Does not cause an OnSelectionChanged()! |
|
|
Private_SetItemExpansion ( |
Set whether some data item is expanded or not. |
|
|
Private_SetItemHighlighted ( |
Enable a soft highlight on the element. |
|
|
Private_SetItemSelection |
Set the selection state of an item. |
|
|
Private_SignalSelectionChanged ( |
Notify the ItemsWidget that we changed its selection. |
|
|
Private_UsesSelectorFocus() |
Returns whether the table view uses selector focus. |
|
|
TSharedPtr< ... |
WidgetFromItem ( |
Find a widget for this item if it has already been constructed. |
Name |
Description |
|
---|---|---|
|
FArguments |
|
|
FSlateAccessibleListView |
An accessible implementation for SListView to be exposed to platform accessibility APIs. |
Name | Description | ||
---|---|---|---|
|
RequestScrollIntoView |
RequestScrollIntoView no longer takes parameter bNavigateOnScrollIntoView. Call RequestNavigateToItem instead of RequestScrollIntoView if navigation is required. |