NDEVR
API Documentation
QCustomToolBox

A toolbox is a widget that displays a column of tabs one above the other, with the current item displayed below the current tab. More...

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

Public Member Functions

 QCustomToolBox (QWidget *parent=nullptr)
 Constructs a toolbox widget.
int addItem (QWidget *widget)
 Adds an item with auto-generated label.
int addItem (QWidget *widget, const QIcon &icon, const QString &label)
 Adds an item with an icon and text label.
int addItem (QWidget *widget, const QString &)
 Adds an item with a text label.
int addItem (QWidget *widget, const TranslatedString &)
 Adds an item with a translated label.
uint04 addWidget (QWidget *child) override
 Adds a widget as a new item in the toolbox.
void clear ()
 Removes all items from the toolbox.
SectionContent * content (int index) const
 Returns the section content at the given item index.
int count () const
 Returns the number of items in the toolbox.
int currentIndex () const
 Returns the index of the currently selected item.
void currentTabChangedSignal (int index)
 Signal emitted when the current item changes.
QWidget * currentWidget () const
 Returns the widget of the currently selected item.
int indexOf (QWidget *widget) const
 Returns the index of the item containing the given widget.
int insertItem (int index, QWidget *widget)
 Inserts an item at the given index with auto-generated label.
int insertItem (int index, QWidget *widget, const QIcon &icon, const QString &label)
 Inserts an item at the given index with an icon and text label.
int insertItem (int index, QWidget *widget, const QString &)
 Inserts an item at the given index with a text label.
int insertItem (int index, QWidget *widget, const TranslatedString &)
 Inserts an item at the given index with a translated label.
bool isItemEnabled (int index) const
 Checks whether the item at the given index is enabled.
QString itemText (int index) const
 Returns the text label of the item at the given index.
QWidget * removeItem (int index)
 Removes and returns the widget at the given index.
void removeItem (QWidget *widget)
 Removes the item containing the given widget.
void setCurrentIndex (uint04 index)
 Sets the currently selected item by index.
void setCurrentIndexSlot (int index)
 Slot to set the current item by index.
void setCurrentWidget (QWidget *widget)
 Sets the currently selected item by widget.
void setCurrentWidgetSlot (QWidget *widget)
 Slot to set the current item by widget.
void setItemEnabled (int index, bool)
 Enables or disables the item at the given index.
void setItemText (int index, const QString &)
 Sets the text label of the item at the given index.
void setMenuMode (bool menu_mode)
 Sets whether the toolbox operates in menu mode, where items behave like a collapsible menu instead of standard tabs.
void setTabBarAutoHide (bool enabled)
 Sets whether the tab bar automatically hides when only one item is present.
void setTabIcon (int index, const QIcon &icon)
 Sets the icon of the tab at the given index.
void setTabLock (bool lock_tab)
 Sets whether the tab headers are locked, preventing user tab switching.
void setTabToolTip (int index, const QString &tip)
 Sets the tooltip text for the tab at the given index.
void setTabVisible (bool tab_visible)
 Sets whether the tab headers are visible.
void setTabWhatsThis (int index, const QString &text)
 Sets the "What's This?" help text for the tab at the given index.
void setupAsBoxWidget (bool is_box_widget)
 Configures the toolbox to display as a box widget layout.
QWidget * tabArea () const
 Returns the tab area widget used for item headers.
QIcon tabIcon (int index) const
 Returns the icon of the tab at the given index.
QString tabToolTip (int index) const
 Returns the tooltip text for the tab at the given index.
QString tabWhatsThis (int index) const
 Returns the "What's This?" help text for the tab at the given index.
QWidget * widget (int index) const
 Returns the widget at the given item index.
Public Member Functions inherited from ContainerWidgetBase
 ContainerWidgetBase (QWidget *parent=nullptr)
 Constructs a ContainerWidgetBase with the given parent widget.
Public Member Functions inherited from QCustomStackedWidgetBase
void animationFinished ()
 Signal emitted when a slide animation completes.
QSize minimumSizeHint () const override
 Returns the minimum recommended size for the stacked widget.
void setAnimation (enum QEasingCurve::Type animationtype)
 Sets the easing curve type used for slide animations.
virtual void setCurrentIdx (uint04 current_index)
 Sets the current visible page index without animation.
void setCustomPixmap (QPixmap *pixmap)
 Sets a custom pixmap to render during slide transitions instead of widget captures.
void setSpeed (int speed)
 Sets the animation duration in milliseconds for slide transitions.
void setVerticalMode (bool vertical=true)
 Enables or disables vertical slide animation mode.
void setWrap (bool wrap)
 Sets whether page navigation wraps around from last to first and vice versa.
QSize sizeHint () const override
 Returns the recommended size for the stacked widget.

Protected Attributes

RibbonArea m_main_ribbon_area
 The ribbon area configuration for the toolbox layout.
QPointer< SectionWidget > m_main_section
 The main section widget hosting the toolbox content.
Dictionary< QWidget *, QCustomDockWidget * > m_managed_section_content
 Maps widgets to their managed dock widget containers.
Protected Attributes inherited from ContainerWidgetBase
bool m_animate_add = true
 Whether to animate the addition of new section content.
DropOverlaym_drop_overlay
 The overlay shown during drag-and-drop operations.
Buffer< std::pair< QPointer< QWidget >, Buffer< QPointer< FloatingWidget > > > > m_fullscreen_stack
 Stack of fullscreen states for navigating back.
Buffer< std::pair< QPointer< QWidget >, Buffer< QPointer< FloatingWidget > > > > m_reset_fullscreen_stack
 Saved fullscreen stack for reset restoration.
bool m_reset_is_on_home = false
 Whether the reset state corresponds to the home layout.
Buffer< UUIDm_reset_visible_sections
 UUIDs of sections that should be visible after a reset.
Dictionary< UUID, SectionContent * > m_section_content
 Maps section content UUIDs to their SectionContent pointers.
Dictionary< UUID, SectionWidget * > m_sections
 Maps section UUIDs to their SectionWidget pointers.
Buffer< SharedSectionContentArea * > m_shared_content
 All shared content area splitters in this container.
SectionWidget * m_top_section_widget = nullptr
 The top-level section widget, if any.
SharedSectionContentArea * m_top_splitter = nullptr
 The top-level splitter managing the layout of all sections.
Protected Attributes inherited from QCustomStackedWidgetBase
double m_animation_percent
 The current animation interpolation percent (0.0 to 1.0).
enum QEasingCurve::Type m_animationtype
 The easing curve type for slide animations.
Buffer< QWidget * > m_child_widgets
 The list of child page widgets.
uint04 m_current_index
 The index of the currently displayed page.
bool m_is_animating
 Whether a slide animation is currently in progress.
uint04 m_last
 The index of the previously displayed page.
int m_last_animation_time
 The duration of the last animation in milliseconds.
QPointer< QPropertyAnimation > m_move_animation
 The property animation driving slide transitions.
uint04 m_next
 The index of the page being animated to.
uint04 m_now
 The index of the currently displayed page during animation.
QPoint m_offset
 The pixel offset used during slide animation rendering.
PopupInfo m_popup_info
 The popup info used for animation origin calculations.
int m_speed
 The animation duration in milliseconds.
bool m_vertical
 Whether slide animations are in vertical mode.
bool m_wrap = false
 Whether page navigation wraps around at boundaries.

Additional Inherited Members

Public Types inherited from QCustomStackedWidgetBase
enum  StackAnimationDirection {
  e_left_to_right , e_right_to_left , e_top_to_bottom , e_bottom_to_top ,
  e_automatic
}
 Defines the direction of slide animations between stacked pages. More...
Static Public Attributes inherited from QCustomStackedWidgetBase
static ApplicationOption< sint04default_stack_animation_speed
 Default time in milliseconds to animate a slide transition.
Protected Member Functions inherited from ContainerWidgetBase
virtual FloatingWidget * addSectionContent (SectionContent *sc)
 Adds section content as a new floating widget.
virtual SectionWidget * addSectionContent (SectionContent *sc, SectionWidget *sw, DropArea area=e_drop_center)
 Adds section content to an existing section widget in the specified drop area.
void beginResetAll ()
 Begins a reset-all operation, saving current state for later restoration.
void bringFloatingWidgetsForward ()
 Brings all floating widgets owned by this container to the front of the window stack.
virtual void clearAllNonFloatingContent ()
 Removes all non-floating section content from this container.
virtual void clearAllSectionContent ()
 Removes all section content from this container, including floating widgets.
Buffer< SectionContent * > contents () const
 Returns all section contents managed by this container.
DropOverlaydropOverlay ()
 Returns the drop overlay used for drag-and-drop visual feedback.
void endResetAll ()
 Ends a reset-all operation, restoring layout to the saved state.
bool event (QEvent *event) override
 Handles events for this widget, including custom event processing.
bool hasSectionContent (SectionContent *sc)
 Checks whether the given section content exists within this container.
bool hideSectionContent (SectionContent *sc, PopupInfo end=PopupInfo())
 Hides the given section content, optionally with popup animation.
bool isSectionContentVisible (SectionContent *sc)
 Checks whether the given section content is currently visible.
FloatingWidget * makeFloating (SectionContent *sc, bool show, PopupInfo start=PopupInfo(), PopupInfo end=PopupInfo())
 Makes the given section content into a floating widget.
FloatingWidget * makeFullScreen (SectionContent *sc, PopupInfo start=PopupInfo())
 Makes the given section content fullscreen.
QSize minimumSizeHint () const override
 Returns the minimum recommended size for this widget.
QRect outerBottomDropRect () const
 Returns the drop rectangle for the outer bottom area of this container.
QRect outerLeftDropRect () const
 Returns the drop rectangle for the outer left area of this container.
QRect outerRightDropRect () const
 Returns the drop rectangle for the outer right area of this container.
QRect outerTopDropRect () const
 Returns the drop rectangle for the outer top area of this container.
bool popWindowStack ()
 Pops the top item from the fullscreen window stack, restoring the previous state.
bool raiseSectionContent (SectionContent *sc)
 Raises the given section content to the front of its section widget.
void removeFromResetShow (UUID id)
 Removes the given section ID from the list of sections to be shown during reset restoration.
bool removeSectionContent (SectionContent *sc)
 Removes the given section content from this container.
void resizeEvent (QResizeEvent *event) override
 Handles resize events to update internal layout geometry.
virtual void setShouldAnimateAdd (bool animate)
 Sets whether adding new section content should be animated.
void setTabLock (bool tab_lock)
 Locks or unlocks tab movement for all section widgets in this container.
bool showSectionContent (SectionContent *sc, PopupInfo start=PopupInfo(), PopupInfo end=PopupInfo())
 Shows the given section content, optionally with popup animation.
QSize sizeHint () const override
 Returns the recommended size for this widget.
void swapSectionContent (SectionContent *section_a, SectionContent *section_b)
 Swaps the positions of two section contents within the container.
Protected Member Functions inherited from QCustomStackedWidgetBase
 QCustomStackedWidgetBase (QWidget *parent=nullptr)
 Constructs the stacked widget base.
uint04 activeIndex () const
 Returns the index of the currently active (or animating-to) widget.
QWidget * activeWidget () const
 Returns the currently active (or animating-to) widget.
void animationDoneSlot ()
 Slot called when the slide animation completes to finalize the transition.
double animationPercent () const
 Returns the current animation interpolation percent.
void childDestroyedSlot (QObject *widget)
 Slot called when a child widget is destroyed, to remove it from the page list.
uint04 count () const
 Returns the number of pages in the stacked widget.
uint04 currentIndex () const
 Returns the index of the currently displayed page.
QWidget * currentWidget () const
 Returns the currently displayed widget.
bool eventFilter (QObject *object, QEvent *event) override
 Filters events for child widgets to handle layout and visibility changes.
uint04 indexOf (QWidget *widget) const
 Returns the index of the given widget in the stacked widget.
void insertWidget (uint04 index, QWidget *w)
 Inserts a widget at a specific index in the stacked widget.
virtual void moveContent (uint04 from, uint04 to)
 Moves a child widget from one index to another.
void paintEvent (QPaintEvent *) override
 Custom paint event that renders slide transition animations.
void removeWidget (QWidget *widget)
 Removes a widget from the stacked widget.
void removeWidget (QWidget *widget, QWidget *slide_to_if_active)
 Removes a widget and slides to a replacement widget if it was the active page.
void resizeEvent (QResizeEvent *event) override
 Handles resize events to update child widget geometries.
void setAnimationPercent (double animation_percent)
 Sets the current animation interpolation percent for the Q_PROPERTY system.
void showEvent (QShowEvent *event) override
 Handles show events to ensure proper layout of the active widget.
virtual void slideInAnimation (enum StackAnimationDirection direction=e_automatic, bool cache_in_image=false)
 Executes the slide animation between the current and next pages.
virtual void slideInAnimation (PopupInfo origin_rect, enum StackAnimationDirection direction=e_automatic, bool cache_in_image=false)
 Executes the slide animation using popup origin information.
virtual void slideInIdx (uint04 idx, enum StackAnimationDirection direction)
 Slides to the page at the given index with the specified direction.
virtual void slideInIdx (uint04 idx, int delay_time=0, enum StackAnimationDirection direction=e_automatic)
 Slides to the page at the given index with animation.
virtual void slideInIdx (uint04 idx, PopupInfo origin_rect, int delay_time=0, enum StackAnimationDirection direction=e_automatic)
 Slides to the page at the given index with animation and popup origin info.
virtual void slideInNext ()
 Slides to the next page with animation.
virtual void slideInPrev ()
 Slides to the previous page with animation.
virtual void slideInWgt (QWidget *widget, enum StackAnimationDirection direction=e_automatic, bool force_slide=false)
 Slides to a specific widget with animation.
virtual void swapIndices (uint04 a, uint04 b)
 Swaps two child widgets at the given indices.
QWidget * widget (uint04 index) const
 Returns the widget at the given index.

Detailed Description

A toolbox is a widget that displays a column of tabs one above the other, with the current item displayed below the current tab.


Every tab has an index position within the column of tabs.

Definition at line 43 of file QCustomToolBox.h.

Constructor & Destructor Documentation

◆ QCustomToolBox()

QCustomToolBox::QCustomToolBox ( QWidget * parent = nullptr)
explicit

Constructs a toolbox widget.

Parameters
[in]parentThe parent widget, or nullptr for no parent.

References QCustomToolBox().

Referenced by QCustomToolBox().

Member Function Documentation

◆ addItem() [1/4]

int QCustomToolBox::addItem ( QWidget * widget)

Adds an item with auto-generated label.

Parameters
[in]widgetThe widget for the new toolbox item.
Returns
The index of the newly added item.

References widget().

◆ addItem() [2/4]

int QCustomToolBox::addItem ( QWidget * widget,
const QIcon & icon,
const QString & label )

Adds an item with an icon and text label.

Parameters
[in]widgetThe widget for the new toolbox item.
[in]iconThe icon for the item.
[in]labelThe text label for the item.
Returns
The index of the newly added item.

References widget().

◆ addItem() [3/4]

int QCustomToolBox::addItem ( QWidget * widget,
const QString &  )

Adds an item with a text label.

Parameters
[in]widgetThe widget for the new toolbox item.
[in]labelThe text label for the item.
Returns
The index of the newly added item.

References widget().

◆ addItem() [4/4]

int QCustomToolBox::addItem ( QWidget * widget,
const TranslatedString &  )

Adds an item with a translated label.

Parameters
[in]widgetThe widget for the new toolbox item.
[in]labelThe translated label for the item.
Returns
The index of the newly added item.

References widget().

◆ addWidget()

uint04 QCustomToolBox::addWidget ( QWidget * child)
overridevirtual

Adds a widget as a new item in the toolbox.

Parameters
[in]childThe widget to add.
Returns
The index of the newly added widget.

Reimplemented from QCustomStackedWidgetBase.

◆ content()

SectionContent * QCustomToolBox::content ( int index) const

Returns the section content at the given item index.

Parameters
[in]indexThe item index.
Returns
A pointer to the SectionContent, or nullptr if invalid.

◆ count()

int QCustomToolBox::count ( ) const

Returns the number of items in the toolbox.

Returns
The item count.

◆ currentIndex()

int QCustomToolBox::currentIndex ( ) const

Returns the index of the currently selected item.

Returns
The current item index.

◆ currentTabChangedSignal()

void QCustomToolBox::currentTabChangedSignal ( int index)

Signal emitted when the current item changes.

Parameters
[in]indexThe index of the newly selected item.

◆ currentWidget()

QWidget * QCustomToolBox::currentWidget ( ) const

Returns the widget of the currently selected item.

Returns
A pointer to the current widget, or nullptr.

◆ indexOf()

int QCustomToolBox::indexOf ( QWidget * widget) const

Returns the index of the item containing the given widget.

Parameters
[in]widgetThe widget to find.
Returns
The item index, or -1 if not found.

References widget().

◆ insertItem() [1/4]

int QCustomToolBox::insertItem ( int index,
QWidget * widget )

Inserts an item at the given index with auto-generated label.

Parameters
[in]indexThe position to insert the item.
[in]widgetThe widget for the new toolbox item.
Returns
The index where the item was inserted.

References widget().

◆ insertItem() [2/4]

int QCustomToolBox::insertItem ( int index,
QWidget * widget,
const QIcon & icon,
const QString & label )

Inserts an item at the given index with an icon and text label.

Parameters
[in]indexThe position to insert the item.
[in]widgetThe widget for the new toolbox item.
[in]iconThe icon for the item.
[in]labelThe text label for the item.
Returns
The index where the item was inserted.

References widget().

◆ insertItem() [3/4]

int QCustomToolBox::insertItem ( int index,
QWidget * widget,
const QString &  )

Inserts an item at the given index with a text label.

Parameters
[in]indexThe position to insert the item.
[in]widgetThe widget for the new toolbox item.
[in]labelThe text label for the item.
Returns
The index where the item was inserted.

References widget().

◆ insertItem() [4/4]

int QCustomToolBox::insertItem ( int index,
QWidget * widget,
const TranslatedString &  )

Inserts an item at the given index with a translated label.

Parameters
[in]indexThe position to insert the item.
[in]widgetThe widget for the new toolbox item.
[in]labelThe translated label for the item.
Returns
The index where the item was inserted.

References widget().

◆ isItemEnabled()

bool QCustomToolBox::isItemEnabled ( int index) const

Checks whether the item at the given index is enabled.

Parameters
[in]indexThe item index.
Returns
True if the item is enabled, false otherwise.

◆ itemText()

QString QCustomToolBox::itemText ( int index) const

Returns the text label of the item at the given index.

Parameters
[in]indexThe item index.
Returns
The item text as a QString.

◆ removeItem() [1/2]

QWidget * QCustomToolBox::removeItem ( int index)

Removes and returns the widget at the given index.

Parameters
[in]indexThe index of the item to remove.
Returns
A pointer to the removed widget.

◆ removeItem() [2/2]

void QCustomToolBox::removeItem ( QWidget * widget)

Removes the item containing the given widget.

Parameters
[in]widgetThe widget whose item should be removed.

References widget().

◆ setCurrentIndex()

void QCustomToolBox::setCurrentIndex ( uint04 index)

Sets the currently selected item by index.

Parameters
[in]indexThe index of the item to select.

◆ setCurrentIndexSlot()

void QCustomToolBox::setCurrentIndexSlot ( int index)

Slot to set the current item by index.

Parameters
[in]indexThe index of the item to select.

◆ setCurrentWidget()

void QCustomToolBox::setCurrentWidget ( QWidget * widget)

Sets the currently selected item by widget.

Parameters
[in]widgetThe widget whose item should be selected.

References widget().

◆ setCurrentWidgetSlot()

void QCustomToolBox::setCurrentWidgetSlot ( QWidget * widget)

Slot to set the current item by widget.

Parameters
[in]widgetThe widget whose item should be selected.

References widget().

◆ setItemEnabled()

void QCustomToolBox::setItemEnabled ( int index,
bool  )

Enables or disables the item at the given index.

Parameters
[in]indexThe item index.
[in]enabledTrue to enable, false to disable.

◆ setItemText()

void QCustomToolBox::setItemText ( int index,
const QString &  )

Sets the text label of the item at the given index.

Parameters
[in]indexThe item index.
[in]textThe new text label.

◆ setMenuMode()

void QCustomToolBox::setMenuMode ( bool menu_mode)

Sets whether the toolbox operates in menu mode, where items behave like a collapsible menu instead of standard tabs.

Parameters
[in]menu_modeTrue to enable menu mode, false for standard mode.

◆ setTabBarAutoHide()

void QCustomToolBox::setTabBarAutoHide ( bool enabled)

Sets whether the tab bar automatically hides when only one item is present.

Parameters
[in]enabledTrue to enable auto-hiding, false to always show.

◆ setTabIcon()

void QCustomToolBox::setTabIcon ( int index,
const QIcon & icon )

Sets the icon of the tab at the given index.

Parameters
[in]indexThe tab index.
[in]iconThe new icon.

◆ setTabLock()

void QCustomToolBox::setTabLock ( bool lock_tab)

Sets whether the tab headers are locked, preventing user tab switching.

Parameters
[in]lock_tabTrue to lock, false to unlock.

◆ setTabToolTip()

void QCustomToolBox::setTabToolTip ( int index,
const QString & tip )

Sets the tooltip text for the tab at the given index.

Parameters
[in]indexThe tab index.
[in]tipThe tooltip text.

◆ setTabVisible()

void QCustomToolBox::setTabVisible ( bool tab_visible)

Sets whether the tab headers are visible.

Parameters
[in]tab_visibleTrue to show the tab headers, false to hide them.

◆ setTabWhatsThis()

void QCustomToolBox::setTabWhatsThis ( int index,
const QString & text )

Sets the "What's This?" help text for the tab at the given index.

Parameters
[in]indexThe tab index.
[in]textThe help text.

◆ setupAsBoxWidget()

void QCustomToolBox::setupAsBoxWidget ( bool is_box_widget)

Configures the toolbox to display as a box widget layout.

Parameters
[in]is_box_widgetTrue to enable box widget mode, false for standard layout.

◆ tabArea()

QWidget * QCustomToolBox::tabArea ( ) const

Returns the tab area widget used for item headers.

Returns
A pointer to the tab area widget.

◆ tabIcon()

QIcon QCustomToolBox::tabIcon ( int index) const

Returns the icon of the tab at the given index.

Parameters
[in]indexThe tab index.
Returns
The tab icon.

◆ tabToolTip()

QString QCustomToolBox::tabToolTip ( int index) const

Returns the tooltip text for the tab at the given index.

Parameters
[in]indexThe tab index.
Returns
The tooltip text as a QString.

◆ tabWhatsThis()

QString QCustomToolBox::tabWhatsThis ( int index) const

Returns the "What's This?" help text for the tab at the given index.

Parameters
[in]indexThe tab index.
Returns
The help text as a QString.

◆ widget()

QWidget * QCustomToolBox::widget ( int index) const

Returns the widget at the given item index.

Parameters
[in]indexThe item index.
Returns
A pointer to the widget, or nullptr if invalid.

Referenced by addItem(), addItem(), addItem(), addItem(), indexOf(), insertItem(), insertItem(), insertItem(), insertItem(), removeItem(), setCurrentWidget(), and setCurrentWidgetSlot().


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