NDEVR
API Documentation
FloatingWidget

Used with the NDEVR API Widget Docking system for widgets that are floating. More...

Public Member Functions

 FloatingWidget (ContainerWidgetBase *container, SectionContent *data, bool is_fullscreen, bool request_margins, QWidget *parent=nullptr)
 Constructs a FloatingWidget.
SectionContentcontent () const
 Returns the section content displayed in this floating widget.
QPoint getDragLocation () const
 Returns the current drag location of this floating widget.
bool isDockedFullscreen () const
 Returns whether this widget is docked in fullscreen mode.
void setContent (SectionContent *data)
 Sets the section content displayed in this floating widget.
void setDockedFullscreen (bool is_fullscreen)
 Sets whether this widget should be docked fullscreen.
void setRibbonArea (RibbonArea drop_area)
 Sets the ribbon area where this widget should dock when dropped.
void setRoundedCorners (int radius)
 Sets the corner rounding radius for the widget border.
virtual QSize sizeHint () const override
 Returns the recommended size for this floating widget.
bool takeContent (SectionContent *data)
 Takes ownership of the given section content, removing it from its previous owner.
SectionTabtitleWidget ()
 Returns the title widget (tab) for this floating widget.

Protected Member Functions

virtual bool event (QEvent *event) override
 Handles events including mouse interaction for dragging.
virtual void hideEvent (QHideEvent *event) override
 Handles the hide event to update the widget state.
virtual void paintEvent (QPaintEvent *e) override
 Paints the widget, including rounded corners if configured.
virtual void showEvent (QShowEvent *event) override
 Handles the show event to update the widget state.

Detailed Description

Used with the NDEVR API Widget Docking system for widgets that are floating.


These widgets appear as windows within the application, though they are still managed by a ContainerWidget.

Definition at line 49 of file FloatingWidget.h.

Constructor & Destructor Documentation

◆ FloatingWidget()

FloatingWidget::FloatingWidget ( ContainerWidgetBase * container,
SectionContent * data,
bool is_fullscreen,
bool request_margins,
QWidget * parent = nullptr )

Constructs a FloatingWidget.

Parameters
[in]containerThe container widget that manages this floating widget.
[in]dataThe section content to display in this floating widget.
[in]is_fullscreenWhether the widget should be displayed fullscreen.
[in]request_marginsWhether to add margins around the content.
[in]parentThe parent widget.

References FloatingWidget().

Referenced by FloatingWidget().

Member Function Documentation

◆ content()

SectionContent * FloatingWidget::content ( ) const
inline

Returns the section content displayed in this floating widget.

Returns
A pointer to the SectionContent.

Definition at line 68 of file FloatingWidget.h.

◆ getDragLocation()

QPoint FloatingWidget::getDragLocation ( ) const

Returns the current drag location of this floating widget.

Returns
The drag position as a QPoint.

◆ isDockedFullscreen()

bool FloatingWidget::isDockedFullscreen ( ) const

Returns whether this widget is docked in fullscreen mode.

Returns
True if docked fullscreen.

◆ setContent()

void FloatingWidget::setContent ( SectionContent * data)

Sets the section content displayed in this floating widget.

Parameters
[in]dataThe section content to display.

◆ setDockedFullscreen()

void FloatingWidget::setDockedFullscreen ( bool is_fullscreen)

Sets whether this widget should be docked fullscreen.

Parameters
[in]is_fullscreenWhether to dock fullscreen.

◆ setRibbonArea()

void FloatingWidget::setRibbonArea ( RibbonArea drop_area)

Sets the ribbon area where this widget should dock when dropped.

Parameters
[in]drop_areaThe ribbon area for docking.

◆ setRoundedCorners()

void FloatingWidget::setRoundedCorners ( int radius)

Sets the corner rounding radius for the widget border.

Parameters
[in]radiusThe corner radius in pixels.

◆ sizeHint()

virtual QSize FloatingWidget::sizeHint ( ) const
overridevirtual

Returns the recommended size for this floating widget.

Returns
The preferred size hint.

◆ takeContent()

bool FloatingWidget::takeContent ( SectionContent * data)

Takes ownership of the given section content, removing it from its previous owner.

Parameters
[in]dataThe section content to take.
Returns
True if the content was successfully taken.

◆ titleWidget()

SectionTab * FloatingWidget::titleWidget ( )
inline

Returns the title widget (tab) for this floating widget.

Returns
A pointer to the SectionTab title widget.

Definition at line 109 of file FloatingWidget.h.


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