UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FWidgetPath Class Reference

#include <WidgetPath.h>

Public Member Functions

SLATECORE_API FWidgetPath ()
 
SLATECORE_API FWidgetPath (TSharedPtr< SWindow > InTopLevelWindow, const FArrangedChildren &InWidgetPath)
 
SLATECORE_API FWidgetPath (TArrayView< FWidgetAndPointer > InWidgetsAndPointers)
 
SLATECORE_API FWidgetPath GetPathDownTo (TSharedRef< const SWidget > MarkerWidget) const
 
TOptional< FVirtualPointerPositionGetVirtualPointerPosition (int32 Index) const
 
SLATECORE_API bool ContainsWidget (const SWidget *WidgetToFind) const
 
SLATECORE_API TOptional< FArrangedWidgetFindArrangedWidget (TSharedRef< const SWidget > WidgetToFind) const
 
SLATECORE_API TOptional< FWidgetAndPointerFindArrangedWidgetAndCursor (TSharedRef< const SWidget > WidgetToFind) const
 
SLATECORE_API TSharedRef< SWindowGetWindow () const
 
SLATECORE_API TSharedRef< SWindowGetDeepestWindow () const
 
SLATECORE_API bool IsValid () const
 
SLATECORE_API FString ToString () const
 
template<typename MatcherType >
bool ExtendPathTo (const MatcherType &Matcher, EVisibility VisibilityFilter=EVisibility::Visible, EWidgetPathSearchPurpose SearchPurpose=EWidgetPathSearchPurpose::Standard)
 
template<typename MatcherType >
FArrangedChildren GeneratePathToWidget (const MatcherType &Matcher, const FArrangedWidget &FromWidget, EUINavigation NavigationType=EUINavigation::Next, EVisibility VisibilityFilter=EVisibility::Visible, EWidgetPathSearchPurpose SearchPurpose=EWidgetPathSearchPurpose::Standard)
 
SLATECORE_API bool MoveFocus (int32 PathLevel, EUINavigation NavigationType, bool bSearchFromPathWidget=true)
 
TSharedRef< SWidgetGetLastWidget () const
 

Public Attributes

FArrangedChildren Widgets
 
TSharedPtr< SWindowTopLevelWindow
 

Detailed Description

A widget path is a vertical slice through the tree. The canonical form for widget paths is "leafmost last". The top-level window always resides at index 0. A widget path also contains a reference to a top-level SWindow that contains all the widgets in the path. The window is needed for its ability to determine its own geometry, from which the geometries of the rest of the widget can be determined.

Constructor & Destructor Documentation

◆ FWidgetPath() [1/3]

FWidgetPath::FWidgetPath ( )

◆ FWidgetPath() [2/3]

FWidgetPath::FWidgetPath ( TSharedPtr< SWindow InTopLevelWindow,
const FArrangedChildren InWidgetPath 
)

◆ FWidgetPath() [3/3]

FWidgetPath::FWidgetPath ( TArrayView< FWidgetAndPointer InWidgetsAndPointers)

Member Function Documentation

◆ ContainsWidget()

bool FWidgetPath::ContainsWidget ( const SWidget WidgetToFind) const
Returns
true if the WidgetToFind is in this WidgetPath, false otherwise.

◆ ExtendPathTo()

template<typename MatcherType >
bool FWidgetPath::ExtendPathTo ( const MatcherType Matcher,
EVisibility  VisibilityFilter = EVisibility::Visible,
EWidgetPathSearchPurpose  SearchPurpose = EWidgetPathSearchPurpose::Standard 
)
inline

Extend the current path such that it reaches some widget that qualifies as a Match The widget to match must be a descendant of the last widget currently in the path.

Parameters
MatcherSome struct that has a "bool IsMatch( const TSharedRef<const SWidget>& InWidget ) const" method
VisibilityFilterWidgets must have this type of visibility to be included the path
SearchPurposeWhat is the purpose for extending the path
Returns
true if successful; false otherwise.

◆ FindArrangedWidget()

TOptional< FArrangedWidget > FWidgetPath::FindArrangedWidget ( TSharedRef< const SWidget WidgetToFind) const

◆ FindArrangedWidgetAndCursor()

PRAGMA_DISABLE_DEPRECATION_WARNINGS TOptional< FWidgetAndPointer > FWidgetPath::FindArrangedWidgetAndCursor ( TSharedRef< const SWidget WidgetToFind) const

◆ GeneratePathToWidget()

template<typename MatcherType >
FArrangedChildren FWidgetPath::GeneratePathToWidget ( const MatcherType Matcher,
const FArrangedWidget FromWidget,
EUINavigation  NavigationType = EUINavigation::Next,
EVisibility  VisibilityFilter = EVisibility::Visible,
EWidgetPathSearchPurpose  SearchPurpose = EWidgetPathSearchPurpose::Standard 
)
inline

Generate a path from FromWidget to WidgetToFind. The path will not include FromWidget.

Parameters
MatcherSome struct that has a "bool IsMatch( const TSharedRef<const SWidget>& InWidget ) const" method
FromWidgetWidget from which we a building a path.AddItem*
VisibilityFilterWidgets must have this type of visibility to be included the path
SearchPurposeWhat is the purpose for generating the path
Returns
A path from FromWidget to WidgetToFind; will not include FromWidget.

◆ GetDeepestWindow()

TSharedRef< SWindow > FWidgetPath::GetDeepestWindow ( ) const

Get the deepest (bottom-most) window in this path; assumes path is valid.

Returns
Window at the bottom of this path.

◆ GetLastWidget()

TSharedRef< SWidget > FWidgetPath::GetLastWidget ( ) const
inline

Get the last (leaf-most) widget in this path; assumes path is valid

◆ GetPathDownTo()

FWidgetPath FWidgetPath::GetPathDownTo ( TSharedRef< const SWidget MarkerWidget) const
Parameters
MarkerWidgetCopy the path up to and including this widget
Returns
a copy of the widget path down to and including the MarkerWidget. If the MarkerWidget is not found in the path, return an invalid path.

◆ GetVirtualPointerPosition()

TOptional< FVirtualPointerPosition > FWidgetPath::GetVirtualPointerPosition ( int32  Index) const
inline

Get the virtual representation of the mouse at each level in the widget path.

◆ GetWindow()

PRAGMA_ENABLE_DEPRECATION_WARNINGS TSharedRef< SWindow > FWidgetPath::GetWindow ( ) const

Get the first (top-most) widget in this path, which is always a window; assumes path is valid.

Returns
Window at the top of this path.

◆ IsValid()

bool FWidgetPath::IsValid ( ) const

A valid path has at least one widget in it

◆ MoveFocus()

bool FWidgetPath::MoveFocus ( int32  PathLevel,
EUINavigation  NavigationType,
bool  bSearchFromPathWidget = true 
)

Move focus either forward on backward in the path level specified by PathLevel. That is, this movement of focus will modify the subtree under Widgets(PathLevel).

Parameters
PathLevelThe level in this WidgetPath whose focus to move.
MoveDirectinMove focus forward or backward?
bSearchFromPathWidgetif set false the search for the next will simply start at the beginning or end of the list of children dependant on the direction
Returns
true if the focus moved successfully, false if we were unable to move focus

◆ ToString()

FString FWidgetPath::ToString ( ) const

Builds a string representation of the widget path.

Member Data Documentation

◆ TopLevelWindow

TSharedPtr<SWindow> FWidgetPath::TopLevelWindow

The top level window of this widget path.

◆ Widgets

FArrangedChildren FWidgetPath::Widgets

The widgets that make up the widget path, the first item is the root widget, the end is the widget this path was built for.


The documentation for this class was generated from the following files: