![]() |
NDEVR
API Documentation
|
SectionWidget manages multiple instances of SectionContent. More...
Public Member Functions | |
| SectionWidget (ContainerWidgetBase *parent, RibbonArea ribbon_area) | |
| Constructs a SectionWidget within the given container and ribbon area. | |
| uint04 | activeIndex () const |
| Returns the index of the currently active (visible) content. | |
| void | addContent (SectionContent *c) |
| Adds section content to this widget without animation. | |
| void | addContent (SectionContent *data, bool animate) |
| Adds section content to this widget with optional animation. | |
| ContainerWidgetBase * | containerWidget () const |
| Returns the container widget that owns this section widget. | |
| uint04 | contentCount () const |
| Returns the number of section contents managed by this widget. | |
| const Buffer< SectionContent * > & | contents () const |
| Returns the buffer of all section contents managed by this widget. | |
| uint04 | currentIndex () const |
| Returns the index of the currently selected content. | |
| void | finishAnimation () |
| Immediately finishes any in-progress collapse or expand animation. | |
| bool | hasVisibleTab () const |
| Returns whether at least one tab is currently visible. | |
| void | hideCurrentSection () |
| Hides the currently displayed section content. | |
| uint04 | indexOf (SectionContent *c) |
| Returns the index of the given section content. | |
| uint04 | indexOfContent (SectionContent *c) const |
| Returns the index of the given section content within this widget. | |
| uint04 | indexOfContentByTitlePos (const QPoint &pos, QWidget *exclude=nullptr) const |
| Finds the index of section content whose tab title is at the given position. | |
| uint04 | indexOfContentByUid (UUID uid) const |
| Finds the index of section content by its UUID. | |
| void | insertContent (uint04 index, SectionContent *data, bool animate) |
| Inserts section content at the specified index with optional animation. | |
| bool | isLayoutVertical () const |
| Returns whether the content layout direction is vertical. | |
| bool | isRibbonHorizontal () const |
| Returns whether the ribbon area is oriented horizontally (top or bottom). | |
| bool | isRibbonLayoutHorizontal () const |
| Returns whether the ribbon layout direction is horizontal. | |
| bool | minimizeAllowed () |
| Returns whether the section widget can be minimized (collapsed). | |
| QSize | minimumSizeHint () const override |
| Returns the minimum recommended size for this section widget. | |
| void | moveContent (uint04 from, uint04 to) |
| Moves content from one index to another. | |
| RibbonArea | ribbonArea () const |
| Returns the ribbon area where this section widget is docked. | |
| void | ribbonLocationChangedSignal (RibbonArea area) |
| Emitted when the ribbon docking location changes. | |
| void | setAnimationProgress (double width) |
| Sets the animation progress for the collapse or expand animation. | |
| void | setCurrentIndex (uint04 index, bool animate) |
| Sets the currently displayed content by index with optional animation. | |
| void | setMinimizeAllowed (bool allowed) |
| Sets whether the section widget can be minimized (collapsed). | |
| void | setRibbonArea (RibbonArea area) |
| Sets the ribbon area where this section widget is docked. | |
| void | setTabLock (bool tab_lock) |
| Locks or unlocks tab dragging and reordering. | |
| void | setTabVisible (bool visible) |
| Sets whether the tab bar is visible. | |
| void | setupAsBoxWidget (bool is_box_widget) |
| Configures this section widget to behave as a box widget with simplified layout. | |
| bool | showTabs () const |
| Returns whether the tab bar is currently shown. | |
| QSize | sizeHint () const override |
| Returns the recommended size for this section widget. | |
| void | swapIndices (uint04 from, uint04 to) |
| Swaps the content at two indices. | |
| void | tabChangedSignal (uint04 idx) |
| Emitted when the active tab index changes. | |
| SectionWidgetTabsScrollArea * | tabScrollArea () |
| Returns the scroll area widget that contains the tab bar. | |
| bool | takeContent (SectionContent *data) |
| Removes and releases the given section content. | |
| bool | takeContent (uint04 index) |
| Removes and releases section content at the given index. | |
| QRect | titleAreaGeometry () const |
| Returns the geometry of the tab title area. | |
| UUID | uid () const |
| Returns the unique identifier for this section widget. | |
| void | updateLayout (QBoxLayout *layout) |
| Updates the internal layout using the provided box layout. | |
| void | updateTabs () |
| Updates the tab bar display to reflect the current content state. | |
| void | userChangedCurrentTabSignal (uint04 idx) |
| Emitted when the user explicitly changes the active tab. | |
Protected Member Functions | |
| bool | event (QEvent *event) override |
| Processes generic events such as style and layout changes. | |
| void | resizeEvent (QResizeEvent *event) override |
| Handles resize events to update tab and content layout. | |
| virtual void | showEvent (QShowEvent *) override |
| Handles the show event to initialize rendering state. | |
| void | updateLayout () |
| Updates the internal layout based on the current ribbon area and content. | |
SectionWidget manages multiple instances of SectionContent.
It displays a title TAB, which is clickable and will switch to the contents associated to the title when clicked.
Definition at line 56 of file SectionWidget.h.
|
explicit |
Constructs a SectionWidget within the given container and ribbon area.
| [in] | parent | The parent container widget. |
| [in] | ribbon_area | The ribbon area where this section widget is docked. |
References SectionWidget().
Referenced by SectionWidget().
| uint04 SectionWidget::activeIndex | ( | ) | const |
Returns the index of the currently active (visible) content.
| void SectionWidget::addContent | ( | SectionContent * | c | ) |
Adds section content to this widget without animation.
| [in] | c | The section content to add. |
| void SectionWidget::addContent | ( | SectionContent * | data, |
| bool | animate ) |
Adds section content to this widget with optional animation.
| [in] | data | The section content to add. |
| [in] | animate | Whether to animate the addition. |
| ContainerWidgetBase * SectionWidget::containerWidget | ( | ) | const |
Returns the container widget that owns this section widget.
| uint04 SectionWidget::contentCount | ( | ) | const |
Returns the number of section contents managed by this widget.
|
inline |
Returns the buffer of all section contents managed by this widget.
Definition at line 92 of file SectionWidget.h.
| uint04 SectionWidget::currentIndex | ( | ) | const |
Returns the index of the currently selected content.
|
overrideprotected |
Processes generic events such as style and layout changes.
| [in] | event | The event to process. |
References event().
Referenced by event(), and resizeEvent().
| bool SectionWidget::hasVisibleTab | ( | ) | const |
Returns whether at least one tab is currently visible.
| uint04 SectionWidget::indexOf | ( | SectionContent * | c | ) |
Returns the index of the given section content.
| [in] | c | The section content to find. |
| uint04 SectionWidget::indexOfContent | ( | SectionContent * | c | ) | const |
Returns the index of the given section content within this widget.
| [in] | c | The section content to find. |
| uint04 SectionWidget::indexOfContentByTitlePos | ( | const QPoint & | pos, |
| QWidget * | exclude = nullptr ) const |
Finds the index of section content whose tab title is at the given position.
| [in] | pos | The position to test in global coordinates. |
| [in] | exclude | An optional widget to exclude from the search. |
| void SectionWidget::insertContent | ( | uint04 | index, |
| SectionContent * | data, | ||
| bool | animate ) |
Inserts section content at the specified index with optional animation.
| [in] | index | The position to insert at. |
| [in] | data | The section content to insert. |
| [in] | animate | Whether to animate the insertion. |
| bool SectionWidget::isLayoutVertical | ( | ) | const |
Returns whether the content layout direction is vertical.
| bool SectionWidget::isRibbonHorizontal | ( | ) | const |
Returns whether the ribbon area is oriented horizontally (top or bottom).
| bool SectionWidget::isRibbonLayoutHorizontal | ( | ) | const |
Returns whether the ribbon layout direction is horizontal.
| bool SectionWidget::minimizeAllowed | ( | ) |
Returns whether the section widget can be minimized (collapsed).
|
override |
Returns the minimum recommended size for this section widget.
Moves content from one index to another.
| [in] | from | The source index. |
| [in] | to | The destination index. |
|
overrideprotected |
|
inline |
Returns the ribbon area where this section widget is docked.
Definition at line 82 of file SectionWidget.h.
| void SectionWidget::ribbonLocationChangedSignal | ( | RibbonArea | area | ) |
Emitted when the ribbon docking location changes.
| [in] | area | The new ribbon area. |
| void SectionWidget::setAnimationProgress | ( | double | width | ) |
Sets the animation progress for the collapse or expand animation.
| [in] | width | The current animation progress value. |
| void SectionWidget::setCurrentIndex | ( | uint04 | index, |
| bool | animate ) |
Sets the currently displayed content by index with optional animation.
| [in] | index | The index to switch to. |
| [in] | animate | Whether to animate the transition. |
| void SectionWidget::setMinimizeAllowed | ( | bool | allowed | ) |
Sets whether the section widget can be minimized (collapsed).
| [in] | allowed | True to allow minimization. |
| void SectionWidget::setRibbonArea | ( | RibbonArea | area | ) |
Sets the ribbon area where this section widget is docked.
| [in] | area | The new ribbon area. |
| void SectionWidget::setTabLock | ( | bool | tab_lock | ) |
Locks or unlocks tab dragging and reordering.
| [in] | tab_lock | True to lock tabs in place. |
| void SectionWidget::setTabVisible | ( | bool | visible | ) |
Sets whether the tab bar is visible.
| [in] | visible | True to show the tab bar. |
| void SectionWidget::setupAsBoxWidget | ( | bool | is_box_widget | ) |
Configures this section widget to behave as a box widget with simplified layout.
| [in] | is_box_widget | True to enable box widget mode. |
|
inline |
Returns whether the tab bar is currently shown.
Definition at line 216 of file SectionWidget.h.
|
override |
Returns the recommended size for this section widget.
Swaps the content at two indices.
| [in] | from | The first index. |
| [in] | to | The second index. |
| void SectionWidget::tabChangedSignal | ( | uint04 | idx | ) |
Emitted when the active tab index changes.
| [in] | idx | The new tab index. |
|
inline |
Returns the scroll area widget that contains the tab bar.
Definition at line 211 of file SectionWidget.h.
| bool SectionWidget::takeContent | ( | SectionContent * | data | ) |
Removes and releases the given section content.
| [in] | data | The section content to remove. |
| bool SectionWidget::takeContent | ( | uint04 | index | ) |
Removes and releases section content at the given index.
| [in] | index | The index of the content to remove. |
| QRect SectionWidget::titleAreaGeometry | ( | ) | const |
Returns the geometry of the tab title area.
| UUID SectionWidget::uid | ( | ) | const |
Returns the unique identifier for this section widget.
Referenced by indexOfContentByUid().
| void SectionWidget::updateLayout | ( | QBoxLayout * | layout | ) |
Updates the internal layout using the provided box layout.
| [in] | layout | The box layout to apply. |
| void SectionWidget::userChangedCurrentTabSignal | ( | uint04 | idx | ) |
Emitted when the user explicitly changes the active tab.
| [in] | idx | The new tab index. |