NDEVR
API Documentation
DropOverlay

Paints a translucent rectangle over another widget. More...

Public Member Functions

 DropOverlay (QWidget *parent)
 Constructs a DropOverlay with the given parent widget.
DropArea cursorLocation () const
 Returns the drop area currently under the mouse cursor.
void hideDropOverlay ()
 Hides the drop overlay.
void setAreaWidgets (const QHash< DropArea, QWidget * > &widgets)
 Sets the mapping of drop areas to their corresponding indicator widgets.
void showDropOverlay (QWidget *target, const QRect &targetAreaRect)
 Shows the drop overlay over the target widget constrained to a specific rectangle.
DropArea showDropOverlay (QWidget *target, QWidget *payload)
 Shows the drop overlay over the target widget for the given payload.

Protected Member Functions

virtual void hideEvent (QHideEvent *e) override
 Handles the hide event to clean up overlay state.
virtual void moveEvent (QMoveEvent *e) override
 Handles move events to update overlay positioning.
virtual void paintEvent (QPaintEvent *e) override
 Paints the translucent drop indicator rectangle.
virtual void resizeEvent (QResizeEvent *e) override
 Handles resize events to update overlay geometry.
virtual void showEvent (QShowEvent *e) override
 Handles the show event to update overlay positioning.

Detailed Description

Paints a translucent rectangle over another widget.


The geometry of the rectangle is based on the mouse location. Used with the NDEVR API Widget Docking system to show where a dock can be placed.

Definition at line 45 of file DropOverlay.h.

Constructor & Destructor Documentation

◆ DropOverlay()

DropOverlay::DropOverlay ( QWidget * parent)

Constructs a DropOverlay with the given parent widget.

Parameters
[in]parentThe parent QWidget.

References DropOverlay().

Referenced by DropOverlay().

Member Function Documentation

◆ cursorLocation()

DropArea DropOverlay::cursorLocation ( ) const

Returns the drop area currently under the mouse cursor.

Returns
The DropArea beneath the cursor.

◆ hideEvent()

virtual void DropOverlay::hideEvent ( QHideEvent * e)
overrideprotectedvirtual

Handles the hide event to clean up overlay state.

Parameters
[in]eThe hide event.

◆ moveEvent()

virtual void DropOverlay::moveEvent ( QMoveEvent * e)
overrideprotectedvirtual

Handles move events to update overlay positioning.

Parameters
[in]eThe move event.

◆ paintEvent()

virtual void DropOverlay::paintEvent ( QPaintEvent * e)
overrideprotectedvirtual

Paints the translucent drop indicator rectangle.

Parameters
[in]eThe paint event.

◆ resizeEvent()

virtual void DropOverlay::resizeEvent ( QResizeEvent * e)
overrideprotectedvirtual

Handles resize events to update overlay geometry.

Parameters
[in]eThe resize event.

◆ setAreaWidgets()

void DropOverlay::setAreaWidgets ( const QHash< DropArea, QWidget * > & widgets)

Sets the mapping of drop areas to their corresponding indicator widgets.

Parameters
[in]widgetsA hash mapping DropArea values to their QWidget indicators.

◆ showDropOverlay() [1/2]

void DropOverlay::showDropOverlay ( QWidget * target,
const QRect & targetAreaRect )

Shows the drop overlay over the target widget constrained to a specific rectangle.

Parameters
[in]targetThe widget being dropped onto.
[in]targetAreaRectThe rectangle within the target to constrain the overlay.

◆ showDropOverlay() [2/2]

DropArea DropOverlay::showDropOverlay ( QWidget * target,
QWidget * payload )

Shows the drop overlay over the target widget for the given payload.

Parameters
[in]targetThe widget being dropped onto.
[in]payloadThe widget being dragged.
Returns
The DropArea currently indicated by the overlay.

◆ showEvent()

virtual void DropOverlay::showEvent ( QShowEvent * e)
overrideprotectedvirtual

Handles the show event to update overlay positioning.

Parameters
[in]eThe show event.

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