NDEVR
API Documentation
SectionWidgetTabsScrollArea

Custom scrollable implementation for docked tabs using the NDEVR API Widget Docking system. More...

Collaboration diagram for SectionWidgetTabsScrollArea:
[legend]

Public Member Functions

 SectionWidgetTabsScrollArea (QWidget *parent=nullptr)
 Constructs a SectionWidgetTabsScrollArea with the given parent widget.
RibbonArea area () const
 Returns the current ribbon area for this scroll area.
void boundsUpdateFinishedSignal ()
 Emitted when the bounds update timer has finished recalculating layout.
uint04 count () const
 Returns the number of tab widgets in this scroll area.
bool event (QEvent *event) override
 Processes generic events such as layout requests and style changes.
bool hasTabWidget (QWidget *widget)
 Returns whether the given tab widget exists in this scroll area.
uint04 indexOf (QWidget *widget) const
 Returns the index of the given widget in the tab list.
void insertMainWidget (uint04 index, QWidget *widget, bool animate)
 Inserts a main content widget at the given index.
void insertTabWidget (uint04 index, QWidget *widget)
 Inserts a tab widget at the given index.
bool isAtBottom () const
 Returns whether the scroll position is at the bottom (or right for horizontal).
bool isAtTop () const
 Returns whether the scroll position is at the top (or left for horizontal).
bool isRelativeVertical () const
 Returns whether the layout is relatively vertical, accounting for ribbon area orientation.
bool isTextVertical () const
 Returns whether the tab text should be rendered vertically.
bool isVertical () const
 Returns whether the layout direction is vertical.
void jumpToBottom ()
 Scrolls the view to the bottom (or right for horizontal layout).
QWidget * mainWidget () const
 Returns the main content widget, if one has been inserted.
QSize minimumSizeHint () const override
 Returns the minimum recommended size for this scroll area.
void move (uint04 from, uint04 to)
 Moves a tab widget from one index to another.
void paintEvent (QPaintEvent *event) override
 Paints the scroll area background.
void removeMainWidget (bool animate)
 Removes the main content widget from the scroll area.
void removeTabWidget (QWidget *widget)
 Removes the given tab widget from the scroll area.
void resizeEvent (QResizeEvent *event) override
 Handles resize events to update scroll behavior and edge indicators.
QScrollArea * scrollArea ()
 Returns the underlying QScrollArea used for scrolling tabs.
void setArea (RibbonArea area)
 Sets the ribbon area, updating layout direction accordingly.
void setAutoExpand (bool auto_expand)
 Sets whether the scroll area should automatically expand to fit all tabs.
void setWidgetSelected (QWidget *widget)
 Sets the given widget as the currently selected tab, updating the highlight.
void showEvent (QShowEvent *) override
 Handles the show event to initialize scroll state.
QSize sizeHint () const override
 Returns the recommended size for this scroll area.
void swap (uint04 a, uint04 b)
 Swaps the positions of two tab widgets.
QWidget * tabsContainer () const
 Returns the container widget that holds the tab widgets.
void updateSeparatorSizes ()
 Updates the sizes of the separator lines between tabs.
QWidget * widget (uint04 index)
 Returns the tab widget at the given index.

Protected Member Functions

void recalculateScrollerSnaps ()
 Recalculates snap positions for the scroller based on tab positions.
void resetScroller ()
 Resets the scroller to its initial position.
QSize scrollSizeHint () const
 Returns the recommended size for the internal scroll content.
void setupSeparator (QFrame *line)
 Configures a QFrame as a separator line between tabs.
QBoxLayout * tabsLayout ()
 Returns the box layout used to arrange tab widgets.
void updateEdgeLocations ()
 Updates the positions of the scroll edge fade indicators.
void updateSelectionWidgetHighlight ()
 Updates the position and size of the selection highlight bar.
void updateSizePolicy ()
 Updates the size policy based on the current layout orientation and content.
virtual void wheelEvent (QWheelEvent *) override
 Handles mouse wheel events for scrolling the tab area.

Protected Attributes

bool m_auto_expand = false
 Whether to auto-expand to fit all tabs without scrolling.
bool m_auto_scroll_to_bottom
 Whether to automatically scroll to bottom on content change.
ScrollEdge * m_bottom_edge
 Fade indicator at the bottom (or right) scroll edge.
QTimer * m_bounds_updater
 Timer for deferred bounds recalculation.
QWidget * m_float_widget
 A floating widget used during drag operations.
SelectionHighlightBarm_highlight_bar
 The animated selection highlight bar.
QWidget * m_inner_scroll
 The inner scrollable widget.
QBoxLayout * m_inner_scroll_layout
 The layout for the inner scroll widget.
bool m_is_bottom = false
 Whether the scroll is currently at the bottom.
bool m_is_shown
 Whether this widget is currently shown.
QWidget * m_main_widget = nullptr
 The main content widget, if present.
uint04 m_main_widget_location = Constant<uint04>::Invalid
 The index of the main widget in the layout.
RibbonArea m_ribbon_area
 The current ribbon area for layout orientation.
QScrollArea * m_scroll_area
 The scroll area containing the tab widgets.
QWidget * m_selected_widget
 The currently selected tab widget.
Buffer< QFrame * > m_separators
 Separator lines between tab widgets.
QSpacerItem * m_spacer_item
 Spacer item used for layout padding.
QWidget * m_tabs_container_widget
 The container widget holding all tabs.
QBoxLayout * m_tabs_layout
 The layout arranging the tab widgets.
ScrollEdge * m_top_edge
 Fade indicator at the top (or left) scroll edge.
uint04 m_update_count
 Counter for pending layout updates.
Buffer< QWidget * > m_widgets
 All tab widgets in display order.

Detailed Description

Custom scrollable implementation for docked tabs using the NDEVR API Widget Docking system.


Definition at line 48 of file SectionWidgetTabsScrollArea.h.

Constructor & Destructor Documentation

◆ SectionWidgetTabsScrollArea()

SectionWidgetTabsScrollArea::SectionWidgetTabsScrollArea ( QWidget * parent = nullptr)

Constructs a SectionWidgetTabsScrollArea with the given parent widget.

Parameters
[in]parentThe parent widget.

References SectionWidgetTabsScrollArea().

Referenced by SectionWidgetTabsScrollArea().

Member Function Documentation

◆ area()

RibbonArea SectionWidgetTabsScrollArea::area ( ) const
inline

Returns the current ribbon area for this scroll area.

Returns
The current RibbonArea.

Definition at line 126 of file SectionWidgetTabsScrollArea.h.

References m_ribbon_area.

Referenced by setArea().

◆ count()

uint04 SectionWidgetTabsScrollArea::count ( ) const

Returns the number of tab widgets in this scroll area.

Returns
The tab count.

◆ event()

bool SectionWidgetTabsScrollArea::event ( QEvent * event)
override

Processes generic events such as layout requests and style changes.

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

References event().

Referenced by event(), paintEvent(), and resizeEvent().

◆ hasTabWidget()

bool SectionWidgetTabsScrollArea::hasTabWidget ( QWidget * widget)

Returns whether the given tab widget exists in this scroll area.

Parameters
[in]widgetThe tab widget to check.
Returns
True if the widget is present.

References widget().

◆ indexOf()

uint04 SectionWidgetTabsScrollArea::indexOf ( QWidget * widget) const

Returns the index of the given widget in the tab list.

Parameters
[in]widgetThe widget to find.
Returns
The index of the widget, or Constant<uint04>::Invalid if not found.

References widget().

◆ insertMainWidget()

void SectionWidgetTabsScrollArea::insertMainWidget ( uint04 index,
QWidget * widget,
bool animate )

Inserts a main content widget at the given index.

Parameters
[in]indexThe position to insert at.
[in]widgetThe widget to insert.
[in]animateWhether to animate the insertion.

References widget().

◆ insertTabWidget()

void SectionWidgetTabsScrollArea::insertTabWidget ( uint04 index,
QWidget * widget )

Inserts a tab widget at the given index.

Parameters
[in]indexThe position to insert at.
[in]widgetThe tab widget to insert.

References widget().

◆ isAtBottom()

bool SectionWidgetTabsScrollArea::isAtBottom ( ) const

Returns whether the scroll position is at the bottom (or right for horizontal).

Returns
True if scrolled to the bottom.

◆ isAtTop()

bool SectionWidgetTabsScrollArea::isAtTop ( ) const

Returns whether the scroll position is at the top (or left for horizontal).

Returns
True if scrolled to the top.

◆ isRelativeVertical()

bool SectionWidgetTabsScrollArea::isRelativeVertical ( ) const

Returns whether the layout is relatively vertical, accounting for ribbon area orientation.

Returns
True if relatively vertical.

◆ isTextVertical()

bool SectionWidgetTabsScrollArea::isTextVertical ( ) const

Returns whether the tab text should be rendered vertically.

Returns
True if text is vertical.

◆ isVertical()

bool SectionWidgetTabsScrollArea::isVertical ( ) const

Returns whether the layout direction is vertical.

Returns
True if the layout is vertical.

◆ mainWidget()

QWidget * SectionWidgetTabsScrollArea::mainWidget ( ) const

Returns the main content widget, if one has been inserted.

Returns
A pointer to the main widget, or nullptr.

◆ minimumSizeHint()

QSize SectionWidgetTabsScrollArea::minimumSizeHint ( ) const
override

Returns the minimum recommended size for this scroll area.

Returns
The minimum size hint.

◆ move()

void SectionWidgetTabsScrollArea::move ( uint04 from,
uint04 to )

Moves a tab widget from one index to another.

Parameters
[in]fromThe source index.
[in]toThe destination index.

◆ paintEvent()

void SectionWidgetTabsScrollArea::paintEvent ( QPaintEvent * event)
override

Paints the scroll area background.

Parameters
[in]eventThe paint event.

References event().

◆ removeMainWidget()

void SectionWidgetTabsScrollArea::removeMainWidget ( bool animate)

Removes the main content widget from the scroll area.

Parameters
[in]animateWhether to animate the removal.

◆ removeTabWidget()

void SectionWidgetTabsScrollArea::removeTabWidget ( QWidget * widget)

Removes the given tab widget from the scroll area.

Parameters
[in]widgetThe tab widget to remove.

References widget().

◆ resizeEvent()

void SectionWidgetTabsScrollArea::resizeEvent ( QResizeEvent * event)
override

Handles resize events to update scroll behavior and edge indicators.

Parameters
[in]eventThe resize event.

References event().

◆ scrollArea()

QScrollArea * SectionWidgetTabsScrollArea::scrollArea ( )
inline

Returns the underlying QScrollArea used for scrolling tabs.

Returns
A pointer to the scroll area.

Definition at line 116 of file SectionWidgetTabsScrollArea.h.

References m_scroll_area.

◆ scrollSizeHint()

QSize SectionWidgetTabsScrollArea::scrollSizeHint ( ) const
protected

Returns the recommended size for the internal scroll content.

Returns
The scroll content size hint.

◆ setArea()

void SectionWidgetTabsScrollArea::setArea ( RibbonArea area)

Sets the ribbon area, updating layout direction accordingly.

Parameters
[in]areaThe ribbon area to set.

References area().

◆ setAutoExpand()

void SectionWidgetTabsScrollArea::setAutoExpand ( bool auto_expand)

Sets whether the scroll area should automatically expand to fit all tabs.

Parameters
[in]auto_expandTrue to enable auto-expansion.

◆ setupSeparator()

void SectionWidgetTabsScrollArea::setupSeparator ( QFrame * line)
protected

Configures a QFrame as a separator line between tabs.

Parameters
[in]lineThe frame to set up as a separator.

◆ setWidgetSelected()

void SectionWidgetTabsScrollArea::setWidgetSelected ( QWidget * widget)

Sets the given widget as the currently selected tab, updating the highlight.

Parameters
[in]widgetThe widget to select.

References widget().

◆ sizeHint()

QSize SectionWidgetTabsScrollArea::sizeHint ( ) const
override

Returns the recommended size for this scroll area.

Returns
The size hint.

◆ swap()

void SectionWidgetTabsScrollArea::swap ( uint04 a,
uint04 b )

Swaps the positions of two tab widgets.

Parameters
[in]aThe index of the first widget.
[in]bThe index of the second widget.

◆ tabsContainer()

QWidget * SectionWidgetTabsScrollArea::tabsContainer ( ) const
inline

Returns the container widget that holds the tab widgets.

Returns
A pointer to the tabs container widget.

Definition at line 72 of file SectionWidgetTabsScrollArea.h.

References m_tabs_container_widget.

◆ tabsLayout()

QBoxLayout * SectionWidgetTabsScrollArea::tabsLayout ( )
inlineprotected

Returns the box layout used to arrange tab widgets.

Returns
A pointer to the tabs layout.

Definition at line 234 of file SectionWidgetTabsScrollArea.h.

References m_tabs_layout.

◆ widget()

QWidget * SectionWidgetTabsScrollArea::widget ( uint04 index)

Returns the tab widget at the given index.

Parameters
[in]indexThe index of the widget to retrieve.
Returns
A pointer to the widget at the given index.

Referenced by hasTabWidget(), indexOf(), insertMainWidget(), insertTabWidget(), removeTabWidget(), and setWidgetSelected().


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