A base class for QDialogs that adds animated transitions for showing and closing.
More...
#include <animated_dialog.h>
|
| void | closeEvent (QCloseEvent *event) override |
| | Overridden close event handler. Prevents immediate closing, starts the close animation (AnimateClose), and fades out the overlay. The actual QDialog::close() is called when the animation finishes.
|
| |
| void | showEvent (QShowEvent *event) override |
| | Overridden show event handler. Creates and shows the overlay widget (if applicable), then starts the show animation (AnimateShow).
|
| |
|
| double | corner_glow_progress_ = 0.0 |
| | Progress property (0.0 to 1.0) potentially for corner glow effects. Animatable.
|
| |
| double | digitalization_progress_ = 0.0 |
| | Progress property (0.0 to 1.0) for the digital materialization effect. Animatable.
|
| |
|
| void | AnimateClose () |
| | Initiates and runs the animation sequence for closing the dialog based on animation_type_. Calls QDialog::close() internally when the animation finishes.
|
| |
| void | AnimateShow () |
| | Initiates and runs the animation sequence for showing the dialog based on animation_type_. Handles different animation types like sliding, fading, and digital materialization. Emits showAnimationFinished() upon completion.
|
| |
|
| AnimationType | animation_type_ |
| | The type of animation selected for this dialog instance.
|
| |
| bool | closing_ |
| | Flag to prevent recursive calls during the animated closing process.
|
| |
| int | duration_ |
| | Duration of the show/close animations in milliseconds.
|
| |
| OverlayWidget * | overlay_ |
| | Pointer to the semi-transparent overlay widget displayed behind the dialog during animation.
|
| |
A base class for QDialogs that adds animated transitions for showing and closing.
This class provides a framework for different animation types (slide, fade, digital materialization) when the dialog appears or disappears. It handles the creation of an optional overlay widget behind the dialog during the transition. Subclasses (like WavelengthDialog, JoinWavelengthDialog) can leverage specific animation types and properties (e.g., digitalizationProgress).
◆ AnimationType
Enum defining the available animation styles for showing and closing the dialog.
| Enumerator |
|---|
| kSlideFromBottom | Dialog slides in from the bottom and out to the bottom.
|
| kDigitalMaterialization | Dialog slides in, fades in, and then applies a digital materialization effect (requires specific dialog subclass properties).
|
◆ AnimatedDialog()
Constructs an AnimatedDialog. Sets necessary window flags and attributes for transparency and animation.
- Parameters
-
| parent | Optional parent widget. |
| type | The type of animation to use for showing and closing. |
◆ ~AnimatedDialog()
| AnimatedDialog::~AnimatedDialog |
( |
| ) |
|
|
override |
Destructor. Ensures the overlay widget is cleaned up.
◆ AnimateClose()
| void AnimatedDialog::AnimateClose |
( |
| ) |
|
|
private |
Initiates and runs the animation sequence for closing the dialog based on animation_type_. Calls QDialog::close() internally when the animation finishes.
◆ AnimateShow()
| void AnimatedDialog::AnimateShow |
( |
| ) |
|
|
private |
Initiates and runs the animation sequence for showing the dialog based on animation_type_. Handles different animation types like sliding, fading, and digital materialization. Emits showAnimationFinished() upon completion.
◆ closeEvent()
| void AnimatedDialog::closeEvent |
( |
QCloseEvent * | event | ) |
|
|
overrideprotected |
Overridden close event handler. Prevents immediate closing, starts the close animation (AnimateClose), and fades out the overlay. The actual QDialog::close() is called when the animation finishes.
- Parameters
-
◆ GetAnimationDuration()
| int AnimatedDialog::GetAnimationDuration |
( |
| ) |
const |
|
inline |
Gets the current duration for the show and close animations.
- Returns
- Animation duration in milliseconds.
◆ SetAnimationDuration()
| void AnimatedDialog::SetAnimationDuration |
( |
const int | duration | ) |
|
|
inline |
Sets the duration for the show and close animations.
- Parameters
-
| duration | Animation duration in milliseconds. |
◆ showAnimationFinished
| void AnimatedDialog::showAnimationFinished |
( |
| ) |
|
|
signal |
Emitted when the show animation (AnimateShow) has finished.
◆ showEvent()
| void AnimatedDialog::showEvent |
( |
QShowEvent * | event | ) |
|
|
overrideprotected |
Overridden show event handler. Creates and shows the overlay widget (if applicable), then starts the show animation (AnimateShow).
- Parameters
-
◆ animation_type_
The type of animation selected for this dialog instance.
◆ closing_
| bool AnimatedDialog::closing_ |
|
private |
Flag to prevent recursive calls during the animated closing process.
◆ corner_glow_progress_
| double AnimatedDialog::corner_glow_progress_ = 0.0 |
|
protected |
Progress property (0.0 to 1.0) potentially for corner glow effects. Animatable.
◆ digitalization_progress_
| double AnimatedDialog::digitalization_progress_ = 0.0 |
|
protected |
Progress property (0.0 to 1.0) for the digital materialization effect. Animatable.
◆ duration_
| int AnimatedDialog::duration_ |
|
private |
Duration of the show/close animations in milliseconds.
◆ overlay_
Pointer to the semi-transparent overlay widget displayed behind the dialog during animation.
The documentation for this class was generated from the following files: