![]() |
NDEVR
API Documentation
|
A base class for a series of widgets where all widgets occupy the same same and only one widget is shown at a time. More...
Public Types | |
| 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... | |
Public Member Functions | |
| 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. | |
Static Public Attributes | |
| static ApplicationOption< sint04 > | default_stack_animation_speed |
| Default time in milliseconds to animate a slide transition. | |
Protected Member Functions | |
| 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. | |
| virtual uint04 | addWidget (QWidget *w) |
| Adds a widget as a new page in the stacked 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. | |
Protected Attributes | |
| 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. | |
A base class for a series of widgets where all widgets occupy the same same and only one widget is shown at a time.
Definition at line 50 of file QCustomStackedWidget.h.
Defines the direction of slide animations between stacked pages.
Definition at line 58 of file QCustomStackedWidget.h.
|
explicitprotected |
Constructs the stacked widget base.
| [in] | parent | The parent widget, or nullptr for no parent. |
References QCustomStackedWidgetBase().
Referenced by QCustomStackedWidget::QCustomStackedWidget(), and QCustomStackedWidgetBase().
|
protected |
Returns the index of the currently active (or animating-to) widget.
Referenced by QCustomStackedWidget::activeIndex().
|
protected |
Returns the currently active (or animating-to) widget.
Referenced by QCustomStackedWidget::activeWidget().
|
protectedvirtual |
Adds a widget as a new page in the stacked widget.
| [in] | w | The widget to add. |
Reimplemented in QCustomStackedWidget, QCustomTabWidget, and QCustomToolBox.
Referenced by QCustomStackedWidget::addWidget().
|
inlineprotected |
Returns the current animation interpolation percent.
Definition at line 132 of file QCustomStackedWidget.h.
References m_animation_percent.
|
protected |
|
protected |
Returns the number of pages in the stacked widget.
Referenced by QCustomStackedWidget::count().
|
inlineprotected |
Returns the index of the currently displayed page.
Definition at line 211 of file QCustomStackedWidget.h.
References m_current_index.
|
protected |
Returns the currently displayed widget.
Referenced by QCustomStackedWidget::currentWidget().
|
overrideprotected |
Filters events for child widgets to handle layout and visibility changes.
| [in] | object | The object that generated the event. |
| [in] | event | The event to filter. |
|
protected |
Returns the index of the given widget in the stacked widget.
| [in] | widget | The widget to find. |
References widget().
Referenced by QCustomStackedWidget::hasWidget(), and QCustomStackedWidget::indexOf().
|
protected |
Inserts a widget at a specific index in the stacked widget.
| [in] | index | The position at which to insert the widget. |
| [in] | w | The widget to insert. |
Referenced by QCustomStackedWidget::insertWidget().
|
override |
Returns the minimum recommended size for the stacked widget.
Moves a child widget from one index to another.
| [in] | from | The source index. |
| [in] | to | The destination index. |
Reimplemented in QCustomStackedWidget.
Referenced by QCustomStackedWidget::moveContent().
|
overrideprotected |
Custom paint event that renders slide transition animations.
| [in] | event | The paint event. |
|
protected |
Removes a widget from the stacked widget.
| [in] | widget | The widget to remove. |
References widget().
Referenced by QCustomStackedWidget::removeWidget(), and QCustomStackedWidget::removeWidget().
|
protected |
|
overrideprotected |
Handles resize events to update child widget geometries.
| [in] | event | The resize event. |
| void QCustomStackedWidgetBase::setAnimation | ( | enum QEasingCurve::Type | animationtype | ) |
Sets the easing curve type used for slide animations.
| [in] | animationtype | The QEasingCurve type to use. |
|
protected |
Sets the current animation interpolation percent for the Q_PROPERTY system.
| [in] | animation_percent | The animation percent from 0.0 to 1.0. |
|
virtual |
Sets the current visible page index without animation.
| [in] | current_index | The index of the page to display. |
Referenced by QCustomStackedWidget::setCurrentIndex().
| void QCustomStackedWidgetBase::setCustomPixmap | ( | QPixmap * | pixmap | ) |
Sets a custom pixmap to render during slide transitions instead of widget captures.
| [in] | pixmap | The custom pixmap to use, or nullptr to use default rendering. |
| void QCustomStackedWidgetBase::setSpeed | ( | int | speed | ) |
Sets the animation duration in milliseconds for slide transitions.
| [in] | speed | The animation duration in milliseconds. |
| void QCustomStackedWidgetBase::setVerticalMode | ( | bool | vertical = true | ) |
Enables or disables vertical slide animation mode.
| [in] | vertical | True for vertical animations, false for horizontal. |
| void QCustomStackedWidgetBase::setWrap | ( | bool | wrap | ) |
|
overrideprotected |
Handles show events to ensure proper layout of the active widget.
| [in] | event | The show event. |
|
override |
Returns the recommended size for the stacked widget.
|
protectedvirtual |
Executes the slide animation between the current and next pages.
| [in] | direction | The animation direction. |
| [in] | cache_in_image | Whether to cache the incoming widget as an image during animation. |
Reimplemented in QCustomStackedWidget.
References e_automatic.
|
protectedvirtual |
Executes the slide animation using popup origin information.
| [in] | origin_rect | The popup info describing the animation origin. |
| [in] | direction | The animation direction. |
| [in] | cache_in_image | Whether to cache the incoming widget as an image during animation. |
Reimplemented in QCustomStackedWidget.
References e_automatic.
Referenced by QCustomStackedWidget::slideInAnimation(), and QCustomStackedWidget::slideInAnimation().
|
protectedvirtual |
Slides to the page at the given index with the specified direction.
| [in] | idx | The target page index. |
| [in] | direction | The animation direction. |
Reimplemented in QCustomStackedWidget, and Ribbon.
|
protectedvirtual |
Slides to the page at the given index with animation.
| [in] | idx | The target page index. |
| [in] | delay_time | Delay in milliseconds before starting the animation. |
| [in] | direction | The animation direction. |
Reimplemented in QCustomStackedWidget.
References e_automatic.
|
protectedvirtual |
Slides to the page at the given index with animation and popup origin info.
| [in] | idx | The target page index. |
| [in] | origin_rect | The popup info describing the animation origin. |
| [in] | delay_time | Delay in milliseconds before starting the animation. |
| [in] | direction | The animation direction. |
Reimplemented in QCustomStackedWidget.
References e_automatic.
Referenced by QCustomStackedWidget::slideInIdx(), QCustomStackedWidget::slideInIdx(), QCustomStackedWidget::slideInIdx(), and Ribbon::slideInIdx().
|
protectedvirtual |
Slides to a specific widget with animation.
| [in] | widget | The widget to slide to. |
| [in] | direction | The animation direction. |
| [in] | force_slide | Whether to force the slide even if the widget is already active. |
Reimplemented in QCustomStackedWidget.
References e_automatic, and widget().
Referenced by QCustomStackedWidget::slideInWgt().
Swaps two child widgets at the given indices.
| [in] | a | The index of the first widget. |
| [in] | b | The index of the second widget. |
Reimplemented in QCustomStackedWidget.
Referenced by QCustomStackedWidget::swapIndices().
|
protected |
Returns the widget at the given index.
| [in] | index | The index of the widget to retrieve. |
Referenced by Ribbon::addBottomRightWidget(), DatasetView::addCustomDockWidget(), Ribbon::addTopLeftWidget(), childDestroyedSlot(), ContainerWidgetBase::event(), indexOf(), removeWidget(), removeWidget(), slideInWgt(), and QCustomStackedWidget::widget().