NDEVR
API Documentation
SectionTababstract

Provides a tab that is used for either a tab if the section content is attached to a Container, or as the drag bar if the content is floating. More...

Inheritance diagram for SectionTab:
[legend]
Collaboration diagram for SectionTab:
[legend]

Public Member Functions

 SectionTab (SectionContent *content, QWidget *parent)
 Constructs a SectionTab associated with the given section content and parent widget.
void activeTabChanged ()
 Emitted when the active tab changes.
void clickedSignal (SectionContent *content)
 Emitted when the tab is clicked.
void closableUpdated (bool is_closeable)
 Emitted when the closable state of this tab changes.
void closedSignal (SectionContent *content)
 Emitted when the tab's close action is triggered.
bool event (QEvent *event) override
 Processes generic events such as style changes.
void fullscreenSignal (bool fullscreen)
 Emitted when the fullscreen state is toggled.
void fullscreenUpdated (bool is_fullscreen)
 Emitted when the fullscreen state of this tab changes.
virtual QIcon getIcon () const
 Returns the icon displayed on this tab.
virtual TranslatedString getTitle () const
 Returns the translated title text displayed on this tab.
bool isActiveTab () const
 Returns whether this tab is currently the active (selected) tab.
virtual bool isMovable () const
 Returns whether this tab can be moved (dragged) by the user.
virtual bool isShown () const
 Returns whether this tab is currently shown.
void isShownUpdated (bool is_shown)
 Emitted when the shown state of this tab changes.
void moveableUpdated (bool is_moveable)
 Emitted when the moveable state of this tab changes.
void setActiveTab (bool active)
 Sets whether this tab is the active (selected) tab.
virtual void setDocked (bool is_docked)=0
 Sets whether this tab is in a docked state.
virtual void setFloatingWidget (FloatingWidget *widget)
 Assigns the floating widget that contains this tab when undocked.
virtual void setFullscreen (bool fullscreen)
 Sets whether the associated content is displayed in fullscreen mode.
void setIsShown (bool shown)
 Sets whether this tab should be shown or hidden.
virtual void setLocation (RibbonArea area, bool is_docked)=0
 Sets the layout location and docked state of this tab.
void setRoundedCorners (int radius_tl, int radius_tr, int radius_bl, int radius_br)
 Sets the rounded corner radii for each corner of the tab.
void setSectionContent (SectionContent *content)
 Sets the section content associated with this tab.
virtual void setSelected (bool is_selected)=0
 Sets the selected visual state of this tab.
void updateClosableSignal ()
 Emitted to request an update of the closable state.
void updateMoveableSignal ()
 Emitted to request an update of the moveable state.
void updateRoundedCorners ()
 Updates the rounded corner radii based on the current docking position.

Protected Member Functions

virtual void leaveEvent (QEvent *event) override
 Handles the leave event when the mouse exits the tab.
virtual void mouseMoveEvent (QMouseEvent *ev) override
 Handles mouse move events during tab dragging.
virtual void mousePressEvent (QMouseEvent *event) override
 Handles mouse press events to initiate tab dragging.
virtual void mouseReleaseEvent (QMouseEvent *ev) override
 Handles mouse release events to complete tab dragging or selection.
void receiveCloseButtonClicked ()
 Processes a close button click by emitting the closedSignal.
void receiveFullScreenButtonClicked ()
 Processes a fullscreen button click by emitting the fullscreenSignal.

Protected Attributes

bool m_active_tab
 Whether this is the currently active tab.
SectionContentm_content
 The section content this tab represents.
QPointF m_drag_start_pos
 The global position where a drag operation started.
FloatingWidgetm_floating_widget
 The floating widget hosting this tab, if any.
bool m_is_fullscreen
 Whether the associated content is in fullscreen mode.
QPointF m_local_drag_pos
 The local position within the tab where the drag started.
bool m_tab_moving
 Whether the tab is currently being dragged.

Detailed Description

Provides a tab that is used for either a tab if the section content is attached to a Container, or as the drag bar if the content is floating.


Definition at line 47 of file SectionTab.h.

Constructor & Destructor Documentation

◆ SectionTab()

SectionTab::SectionTab ( SectionContent * content,
QWidget * parent )

Constructs a SectionTab associated with the given section content and parent widget.

Parameters
[in]contentThe section content this tab represents.
[in]parentThe parent widget.

References SectionTab().

Referenced by SectionTab().

Member Function Documentation

◆ clickedSignal()

void SectionTab::clickedSignal ( SectionContent * content)

Emitted when the tab is clicked.

Parameters
[in]contentThe section content associated with this tab.

◆ closableUpdated()

void SectionTab::closableUpdated ( bool is_closeable)

Emitted when the closable state of this tab changes.

Parameters
[in]is_closeableTrue if the tab is now closable.

◆ closedSignal()

void SectionTab::closedSignal ( SectionContent * content)

Emitted when the tab's close action is triggered.

Parameters
[in]contentThe section content being closed.

◆ event()

bool SectionTab::event ( QEvent * event)
override

Processes generic events such as style changes.

Parameters
[in]eventThe event to process.
Returns
True if the event was handled.

References event().

Referenced by event(), leaveEvent(), and mousePressEvent().

◆ fullscreenSignal()

void SectionTab::fullscreenSignal ( bool fullscreen)

Emitted when the fullscreen state is toggled.

Parameters
[in]fullscreenThe new fullscreen state.

◆ fullscreenUpdated()

void SectionTab::fullscreenUpdated ( bool is_fullscreen)

Emitted when the fullscreen state of this tab changes.

Parameters
[in]is_fullscreenTrue if now in fullscreen mode.

◆ getIcon()

virtual QIcon SectionTab::getIcon ( ) const
inlinevirtual

Returns the icon displayed on this tab.

Returns
The tab icon, or an empty QIcon by default.

Reimplemented in SectionIconTab.

Definition at line 198 of file SectionTab.h.

◆ getTitle()

virtual TranslatedString SectionTab::getTitle ( ) const
virtual

Returns the translated title text displayed on this tab.

Returns
The title as a TranslatedString.

Reimplemented in SectionIconTab.

◆ isActiveTab()

bool SectionTab::isActiveTab ( ) const

Returns whether this tab is currently the active (selected) tab.

Returns
True if this is the active tab.

◆ isMovable()

virtual bool SectionTab::isMovable ( ) const
virtual

Returns whether this tab can be moved (dragged) by the user.

Returns
True if the tab is movable.

◆ isShown()

virtual bool SectionTab::isShown ( ) const
virtual

Returns whether this tab is currently shown.

Returns
True if the tab is visible.

◆ isShownUpdated()

void SectionTab::isShownUpdated ( bool is_shown)

Emitted when the shown state of this tab changes.

Parameters
[in]is_shownTrue if the tab is now shown.

◆ leaveEvent()

virtual void SectionTab::leaveEvent ( QEvent * event)
overrideprotectedvirtual

Handles the leave event when the mouse exits the tab.

Parameters
[in]eventThe leave event.

References event().

◆ mouseMoveEvent()

virtual void SectionTab::mouseMoveEvent ( QMouseEvent * ev)
overrideprotectedvirtual

Handles mouse move events during tab dragging.

Parameters
[in]evThe mouse move event.

◆ mousePressEvent()

virtual void SectionTab::mousePressEvent ( QMouseEvent * event)
overrideprotectedvirtual

Handles mouse press events to initiate tab dragging.

Parameters
[in]eventThe mouse press event.

References event().

◆ mouseReleaseEvent()

virtual void SectionTab::mouseReleaseEvent ( QMouseEvent * ev)
overrideprotectedvirtual

Handles mouse release events to complete tab dragging or selection.

Parameters
[in]evThe mouse release event.

◆ moveableUpdated()

void SectionTab::moveableUpdated ( bool is_moveable)

Emitted when the moveable state of this tab changes.

Parameters
[in]is_moveableTrue if the tab is now moveable.

◆ setActiveTab()

void SectionTab::setActiveTab ( bool active)

Sets whether this tab is the active (selected) tab.

Parameters
[in]activeTrue to make this the active tab.

◆ setDocked()

virtual void SectionTab::setDocked ( bool is_docked)
pure virtual

Sets whether this tab is in a docked state.

Pure virtual.

Parameters
[in]is_dockedTrue if docked.

Implemented in SectionIconTab.

◆ setFloatingWidget()

virtual void SectionTab::setFloatingWidget ( FloatingWidget * widget)
virtual

Assigns the floating widget that contains this tab when undocked.

Parameters
[in]widgetThe floating widget, or nullptr if not floating.

Reimplemented in SectionIconTab.

◆ setFullscreen()

virtual void SectionTab::setFullscreen ( bool fullscreen)
virtual

Sets whether the associated content is displayed in fullscreen mode.

Parameters
[in]fullscreenTrue if fullscreen.

Reimplemented in SectionIconTab.

◆ setIsShown()

void SectionTab::setIsShown ( bool shown)

Sets whether this tab should be shown or hidden.

Parameters
[in]shownTrue to show the tab.

◆ setLocation()

virtual void SectionTab::setLocation ( RibbonArea area,
bool is_docked )
pure virtual

Sets the layout location and docked state of this tab.

Pure virtual.

Parameters
[in]areaThe ribbon area where the tab is positioned.
[in]is_dockedTrue if the tab is docked.

Implemented in SectionIconTab.

◆ setRoundedCorners()

void SectionTab::setRoundedCorners ( int radius_tl,
int radius_tr,
int radius_bl,
int radius_br )

Sets the rounded corner radii for each corner of the tab.

Parameters
[in]radius_tlTop-left corner radius.
[in]radius_trTop-right corner radius.
[in]radius_blBottom-left corner radius.
[in]radius_brBottom-right corner radius.

◆ setSectionContent()

void SectionTab::setSectionContent ( SectionContent * content)

Sets the section content associated with this tab.

Parameters
[in]contentThe section content to associate.

◆ setSelected()

virtual void SectionTab::setSelected ( bool is_selected)
pure virtual

Sets the selected visual state of this tab.

Pure virtual.

Parameters
[in]is_selectedTrue if selected.

Implemented in SectionIconTab.


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