SFilterBar

A Filter Bar widget, which can be used to filter items of type [FilterType] given a list of custom filters along with built in support for Asset Type filters

Unreal Engine C++ API Reference > Editor > EditorWidgets > Filters

Inheritance Hierarchy

References

   
Module EditorWidgets
Header /Engine/Source/Editor/EditorWidgets/Public/Filters/SFilterBar.h
Include #include "Filters/SFilterBar.h"

Syntax

template<typename FilterType>  
class SFilterBar : public [SAssetFilterBar< FilterType >](API\Editor\EditorWidgets\Filters\SAssetFilterBar)  

Remarks

A Filter Bar widget, which can be used to filter items of type [FilterType] given a list of custom filters along with built in support for Asset Type filters Sample Usage: SAssignNew(MyFilterBar, SFilterBar) .OnFilterChanged() // A delegate for when the list of filters changes .CustomFilters() // An array of filters available to this FilterBar ( Use the GetAllActiveFilters() function to get the FilterCollection of Active Filters in this FilterBar, that can be used to filter your items. NOTE: GetAllActiveFilters() must be called every time the filters change (in OnFilterChanged() for example) to make sure you have the correct backend filter NOTE: Use CustomClassFilters to provide any Type Filters to make sure they get resolved properly (See FCustomClassFilterData) NOTE: Use MakeAddFilterButton() to make the button that summons the dropdown showing all the filters

Functions

Type Name Description
void Construct ( const FArguments& InArgs ) Constructs this widget with InArgs

Overridden from SBasicFilterBar

Type Name Description
TSharedPtr< ... GetAllActiveFilters () Use this function to get all currently active filters (to filter your items) NOTE: Must be called every time the filters change (OnFilterChanged) to make sure you get the correct combined filter

Classes

Type Name Description
Public struct FArguments  

Typedefs

See Also

SBasicFilterBarif you don't want Asset Type filters

or if you want a filter bar usable in non-editor situations NOTE: You will need to also add "ToolWidgets" as a dependency to your module to usethis widget NOTE: The filter functions create copies

so you want to useSFilterBar<TSharedPtr> etc instead of SFilterBar when possible NOTE: The user must specify one of the following: a) OnConvertItemToAssetData: A conversion function to convert FilterType to an FAssetData. Specifying this will filter the asset type through the AssetRegistry

which is potentially more thorough and fast b) OnCompareItemWithClassName: A comparison function to checkif an Item (FilterType) is the same as an AssetType (represented by an FName). This allows to user to directly text compare with ClassNames (UObjectBase::GetFName)

which is easier but potentially slower

FGenericFilter to create simple delegate based filters) .OnConvertItemToAssetData() // Conversion Function as mentioned above


Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library