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

#include <DragAndDrop.h>

+ Inheritance diagram for FDragDropOperation:

Public Member Functions

SLATECORE_API FDragDropOperation ()
 
virtual SLATECORE_API ~FDragDropOperation ()
 
template<class TType >
bool IsOfType () const
 
virtual bool AffectedByPointerEvent (const FPointerEvent &PointerEvent)
 
virtual SLATECORE_API void OnDrop (bool bDropWasHandled, const FPointerEvent &MouseEvent)
 
virtual SLATECORE_API void OnDragged (const class FDragDropEvent &DragDropEvent)
 
virtual SLATECORE_API FCursorReply OnCursorQuery ()
 
virtual TSharedPtr< SWidgetGetDefaultDecorator () const
 
virtual FVector2D GetDecoratorPosition () const
 
virtual SLATECORE_API void SetDecoratorVisibility (bool bVisible)
 
virtual bool IsExternalOperation () const
 
virtual bool IsWindowlessOperation () const
 
SLATECORE_API void SetCursorOverride (TOptional< EMouseCursor::Type > CursorType)
 
virtual bool IsOfTypeImpl (const FString &Type) const
 
- Public Member Functions inherited from TSharedFromThis< FDragDropOperation >
TSharedRef< FDragDropOperation, Mode > AsShared ()
 
TSharedRef< FDragDropOperation const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< FDragDropOperation, Mode > AsWeak ()
 
TWeakPtr< FDragDropOperation const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Protected Member Functions

virtual SLATECORE_API void Construct ()
 
SLATECORE_API void CreateCursorDecoratorWindow ()
 
SLATECORE_API void DestroyCursorDecoratorWindow ()
 
virtual TSharedPtr< FDragDropOperationConvertTo (const FString &TypeId)
 
- Protected Member Functions inherited from TSharedFromThis< FDragDropOperation >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 

Protected Attributes

bool bCreateNewWindow
 
TSharedPtr< SWindowCursorDecoratorWindow
 
TOptional< EMouseCursor::TypeMouseCursor
 
TOptional< EMouseCursor::TypeMouseCursorOverride
 

Additional Inherited Members

- Static Protected Member Functions inherited from TSharedFromThis< FDragDropOperation >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Detailed Description

A base class for a DragAndDrop operation which supports reflection. Drag and Drop is inherently quite stateful. Implementing a custom DragDropOperation allows for dedicated handling of a drag drop operation which keeps a decorator window (optionally) Implement derived types with DRAG_DROP_OPERATOR_TYPE (see below)

Constructor & Destructor Documentation

◆ FDragDropOperation()

FDragDropOperation::FDragDropOperation ( )

Default constructor.

◆ ~FDragDropOperation()

FDragDropOperation::~FDragDropOperation ( )
virtual

Destructor.

Member Function Documentation

◆ AffectedByPointerEvent()

virtual bool FDragDropOperation::AffectedByPointerEvent ( const FPointerEvent PointerEvent)
inlinevirtual

Checks if this drag and drop operation is affected by a given PointerEvent.

Parameters
PointerEventThe mouse event we are checking against
Returns
true if the the pointer event affects this drag and drop operation (default true).

Reimplemented in FUMGDragDropOp.

◆ Construct()

void FDragDropOperation::Construct ( )
protectedvirtual

Constructs the window and widget if applicable.

Reimplemented in FUMGDragDropOp.

◆ ConvertTo()

virtual TSharedPtr< FDragDropOperation > FDragDropOperation::ConvertTo ( const FString &  TypeId)
inlineprotectedvirtual

◆ CreateCursorDecoratorWindow()

void FDragDropOperation::CreateCursorDecoratorWindow ( )
protected

Creates a window for the cursor decorator.

◆ DestroyCursorDecoratorWindow()

void FDragDropOperation::DestroyCursorDecoratorWindow ( )
protected

Destroys the cursor decorator window.

◆ GetDecoratorPosition()

virtual FVector2D FDragDropOperation::GetDecoratorPosition ( ) const
inlinevirtual

Gets the desired position of the decorator in absolute space.

Reimplemented in FGameDragDropOperation.

◆ GetDefaultDecorator()

virtual TSharedPtr< SWidget > FDragDropOperation::GetDefaultDecorator ( ) const
inlinevirtual

Gets the widget that will serve as the decorator unless overridden. If you do not override, you will have no decorator

Reimplemented in FUICommandDragDropOp, and FUMGDragDropOp.

◆ IsExternalOperation()

virtual bool FDragDropOperation::IsExternalOperation ( ) const
inlinevirtual

Is this drag Drop operation going to interact with applications outside of Slate

◆ IsOfType()

template<class TType >
bool FDragDropOperation::IsOfType ( ) const
inline

Check if this drag and drop operation can cast safely to the specified template type

◆ IsOfTypeImpl()

virtual bool FDragDropOperation::IsOfTypeImpl ( const FString &  Type) const
inlinevirtual

Checks whether this drag and drop operation can cast safely to the specified type.

◆ IsWindowlessOperation()

virtual bool FDragDropOperation::IsWindowlessOperation ( ) const
inlinevirtual
Returns
true if the operation does not create a decorator window. Used for game drag drop operations.

◆ OnCursorQuery()

FCursorReply FDragDropOperation::OnCursorQuery ( )
virtual

Allows drag/drop operations to override the current cursor

Reimplemented in FUMGDragDropOp.

◆ OnDragged()

void FDragDropOperation::OnDragged ( const class FDragDropEvent DragDropEvent)
virtual

Called when the mouse was moved during a drag and drop operation

Parameters
DragDropEventThe event that describes this drag drop operation.

Reimplemented in FUICommandDragDropOp, and FUMGDragDropOp.

◆ OnDrop()

void FDragDropOperation::OnDrop ( bool  bDropWasHandled,
const FPointerEvent MouseEvent 
)
virtual

Invoked when the drag and drop operation has ended.

Parameters
bDropWasHandledtrue when the drop was handled by some widget; false otherwise
MouseEventThe mouse event which caused the on drop to be called.

Reimplemented in FDockingDragOperation, FUICommandDragDropOp, and FUMGDragDropOp.

◆ SetCursorOverride()

void FDragDropOperation::SetCursorOverride ( TOptional< EMouseCursor::Type CursorType)

Sets the cursor to override the drag drop operations cursor with so that a control can give temporary feedback, for example - a slashed circle telling the user 'this can't be dropped here'.

◆ SetDecoratorVisibility()

void FDragDropOperation::SetDecoratorVisibility ( bool  bVisible)
virtual

Alters the visibility of the window

Member Data Documentation

◆ bCreateNewWindow

bool FDragDropOperation::bCreateNewWindow
protected

Create a new window for the decorator content. If this is false, SlateApplication will draw the decorator directly using the

◆ CursorDecoratorWindow

TSharedPtr<SWindow> FDragDropOperation::CursorDecoratorWindow
protected

The window that owns the decorator widget

◆ MouseCursor

TOptional<EMouseCursor::Type> FDragDropOperation::MouseCursor
protected

Mouse cursor used by the drag drop operation

◆ MouseCursorOverride

TOptional<EMouseCursor::Type> FDragDropOperation::MouseCursorOverride
protected

Mouse cursor used to temporarily replace the drag drops cursor


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