CCIMXDesktop
 
Loading...
Searching...
No Matches
CardStackWidget Class Reference

An enhanced QStackedWidget with animated card transitions. More...

#include <CardStackWidget.h>

Inheritance diagram for CardStackWidget:

Public Types

enum class  CardTransitionMode { Slide , Fade }
 Available transition animation modes. More...
 

Public Member Functions

 CardStackWidget (QWidget *parent=nullptr)
 Constructs a CardStackWidget.
 
void setCardTransitionMode (CardTransitionMode mode)
 Sets the transition animation mode.
 
CardTransitionMode cardTransitionMode () const
 Gets the current transition mode.
 
void slideTo (int newIndex)
 Animates transition to a specific card.
 
void setablility_of_autoSwitch (bool ability)
 Enables/disables automatic card switching.
 
bool autoSwitchAbility ()
 Checks if auto-switching is enabled.
 

Static Public Attributes

static constexpr ValueLimitSimplePair animation_bound { 250, 500 }
 
static constexpr ValueLimitSimplePair timer_switch_invoker { 3000, 10000 }
 

Protected Member Functions

void mousePressEvent (QMouseEvent *event) override
 Handles mouse press events for drag detection.
 
void mouseReleaseEvent (QMouseEvent *event) override
 Handles mouse release events for drag completion.
 
void mouseMoveEvent (QMouseEvent *event) override
 Handles mouse move events for drag tracking.
 

Detailed Description

An enhanced QStackedWidget with animated card transitions.

Provides a stack of widgets with customizable transition animations (slide/fade) and optional automatic switching between cards.

Member Enumeration Documentation

◆ CardTransitionMode

Available transition animation modes.

Enumerator
Slide 

Slide animation between cards

Fade 

Fade animation between cards

Constructor & Destructor Documentation

◆ CardStackWidget()

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

Constructs a CardStackWidget.

Parameters
parentParent widget (optional)

Member Function Documentation

◆ autoSwitchAbility()

bool CardStackWidget::autoSwitchAbility ( )

Checks if auto-switching is enabled.

Returns
true if enabled, false otherwise

◆ cardTransitionMode()

CardStackWidget::CardTransitionMode CardStackWidget::cardTransitionMode ( ) const

Gets the current transition mode.

Returns
The current transition mode

◆ mouseMoveEvent()

void CardStackWidget::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

Handles mouse move events for drag tracking.

Parameters
eventThe mouse event

◆ mousePressEvent()

void CardStackWidget::mousePressEvent ( QMouseEvent *  event)
overrideprotected

Handles mouse press events for drag detection.

Parameters
eventThe mouse event

◆ mouseReleaseEvent()

void CardStackWidget::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

Handles mouse release events for drag completion.

Parameters
eventThe mouse event

◆ setablility_of_autoSwitch()

void CardStackWidget::setablility_of_autoSwitch ( bool  ability)

Enables/disables automatic card switching.

Parameters
abilitytrue to enable, false to disable

◆ setCardTransitionMode()

void CardStackWidget::setCardTransitionMode ( CardTransitionMode  mode)

Sets the transition animation mode.

Parameters
modeThe transition mode to use

◆ slideTo()

void CardStackWidget::slideTo ( int  newIndex)

Animates transition to a specific card.

Parameters
newIndexIndex of the card to transition to

Member Data Documentation

◆ animation_bound

constexpr ValueLimitSimplePair CardStackWidget::animation_bound { 250, 500 }
staticconstexpr

Bounds for animation duration

◆ timer_switch_invoker

constexpr ValueLimitSimplePair CardStackWidget::timer_switch_invoker { 3000, 10000 }
staticconstexpr

Bounds for auto-switch timer


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