NDEVR
API Documentation
ResizeVisibleAnimation

Responsible for animating widgets by having them grown as they become visible, or shrink as they become invisible. More...

Public Member Functions

double activeSize () const
 Returns the current animated size value.
void finishedSignal ()
 Signal emitted when the animation finishes.
void reverse ()
 Reverses the animation direction.
void setActiveSize (double size)
 Sets the current animated size value, driving the animation progress.
void setDeleteWidgetOnEnd (bool delete_widget)
 Sets whether the widget should be deleted when the animation finishes.
void setup (int duration, int start_delay, bool ignore_max_min_size)
 Configures the animation timing and size constraints.
void updatedSignal ()
 Signal emitted when the animation value is updated.

Static Public Member Functions

static ResizeVisibleAnimationActiveAnimation (QWidget *widget)
 Returns the currently active resize animation for a widget, if any.
static ResizeVisibleAnimationrun (QWidget *widget, bool visible, bool vertical, int duration=-1, int delay=0)
 Creates and runs a resize animation for showing or hiding a widget.
static ResizeVisibleAnimationrun (QWidget *widget, bool visible, const PopupInfo &start_location, const PopupInfo &end_location, int duration=-1, int delay=0)
 Creates and runs a resize animation between two popup locations.
static ResizeVisibleAnimationrunRemove (QWidget *widget, bool vertical, int duration=-1, int delay=0)
 Creates and runs a hide-then-remove animation for a widget.
static void setTopLevelWidget (QWidget *top_widget)
 Sets the top-level widget used as a reference for popup animations.

Protected Member Functions

 ResizeVisibleAnimation (QWidget *widget, bool visible, bool vertical, int duration=300, int delay=0)
 Constructs a resize animation for showing or hiding a widget vertically or horizontally.
 ResizeVisibleAnimation (QWidget *widget, bool visible, PopupInfo start_location, PopupInfo end_location, int duration=300, int delay=0)
 Constructs a resize animation that animates a widget between two popup locations.
void startAnimation ()
 Slot that starts the animation after any configured delay.

Detailed Description

Responsible for animating widgets by having them grown as they become visible, or shrink as they become invisible.


For some operating systems will also apply a fade effect.

Definition at line 48 of file ResizeVisibleAnimation.h.

Constructor & Destructor Documentation

◆ ResizeVisibleAnimation() [1/2]

ResizeVisibleAnimation::ResizeVisibleAnimation ( QWidget * widget,
bool visible,
bool vertical,
int duration = 300,
int delay = 0 )
protected

Constructs a resize animation for showing or hiding a widget vertically or horizontally.

Parameters
[in]widgetThe widget to animate.
[in]visibleWhether the widget is becoming visible (true) or hidden (false).
[in]verticalWhether to animate along the vertical axis.
[in]durationThe animation duration in milliseconds.
[in]delayThe delay in milliseconds before the animation starts.

Referenced by ResizeVisibleAnimation(), ActiveAnimation(), run(), run(), and runRemove().

◆ ResizeVisibleAnimation() [2/2]

ResizeVisibleAnimation::ResizeVisibleAnimation ( QWidget * widget,
bool visible,
PopupInfo start_location,
PopupInfo end_location,
int duration = 300,
int delay = 0 )
protected

Constructs a resize animation that animates a widget between two popup locations.

Parameters
[in]widgetThe widget to animate.
[in]visibleWhether the widget is becoming visible (true) or hidden (false).
[in]start_locationThe starting popup position and size.
[in]end_locationThe ending popup position and size.
[in]durationThe animation duration in milliseconds.
[in]delayThe delay in milliseconds before the animation starts.

References ResizeVisibleAnimation().

Member Function Documentation

◆ ActiveAnimation()

ResizeVisibleAnimation * ResizeVisibleAnimation::ActiveAnimation ( QWidget * widget)
static

Returns the currently active resize animation for a widget, if any.

Parameters
[in]widgetThe widget to query.
Returns
Pointer to the active animation, or nullptr.

References ResizeVisibleAnimation().

◆ activeSize()

double ResizeVisibleAnimation::activeSize ( ) const
inline

Returns the current animated size value.

Returns
The animation progress from 0.0 to 1.0.

Definition at line 99 of file ResizeVisibleAnimation.h.

◆ run() [1/2]

ResizeVisibleAnimation * ResizeVisibleAnimation::run ( QWidget * widget,
bool visible,
bool vertical,
int duration = -1,
int delay = 0 )
static

Creates and runs a resize animation for showing or hiding a widget.

Parameters
[in]widgetThe widget to animate.
[in]visibleWhether the widget is becoming visible.
[in]verticalWhether to animate along the vertical axis.
[in]durationThe animation duration in milliseconds, or -1 for default.
[in]delayThe delay before starting in milliseconds.
Returns
Pointer to the running animation.

References ResizeVisibleAnimation().

◆ run() [2/2]

ResizeVisibleAnimation * ResizeVisibleAnimation::run ( QWidget * widget,
bool visible,
const PopupInfo & start_location,
const PopupInfo & end_location,
int duration = -1,
int delay = 0 )
static

Creates and runs a resize animation between two popup locations.

Parameters
[in]widgetThe widget to animate.
[in]visibleWhether the widget is becoming visible.
[in]start_locationThe starting position and size.
[in]end_locationThe ending position and size.
[in]durationThe animation duration in milliseconds, or -1 for default.
[in]delayThe delay before starting in milliseconds.
Returns
Pointer to the running animation.

References ResizeVisibleAnimation().

◆ runRemove()

ResizeVisibleAnimation * ResizeVisibleAnimation::runRemove ( QWidget * widget,
bool vertical,
int duration = -1,
int delay = 0 )
static

Creates and runs a hide-then-remove animation for a widget.

Parameters
[in]widgetThe widget to animate and remove.
[in]verticalWhether to animate along the vertical axis.
[in]durationThe animation duration in milliseconds, or -1 for default.
[in]delayThe delay before starting in milliseconds.
Returns
Pointer to the running animation.

References ResizeVisibleAnimation().

◆ setActiveSize()

void ResizeVisibleAnimation::setActiveSize ( double size)

Sets the current animated size value, driving the animation progress.

Parameters
[in]sizeThe current animation size (0.0 to 1.0).

◆ setDeleteWidgetOnEnd()

void ResizeVisibleAnimation::setDeleteWidgetOnEnd ( bool delete_widget)
inline

Sets whether the widget should be deleted when the animation finishes.

Parameters
[in]delete_widgetTrue to delete the widget on animation end.

Definition at line 83 of file ResizeVisibleAnimation.h.

◆ setTopLevelWidget()

void ResizeVisibleAnimation::setTopLevelWidget ( QWidget * top_widget)
static

Sets the top-level widget used as a reference for popup animations.

Parameters
[in]top_widgetThe top-level application widget.

◆ setup()

void ResizeVisibleAnimation::setup ( int duration,
int start_delay,
bool ignore_max_min_size )

Configures the animation timing and size constraints.

Parameters
[in]durationThe animation duration in milliseconds.
[in]start_delayThe delay in milliseconds before starting.
[in]ignore_max_min_sizeWhether to temporarily ignore the widget's min/max size constraints.

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