TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Public Types | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
MusicAnimationStackedWidget Class Reference

The class of the statckwidget switch animation. More...

#include <musicanimationstackedwidget.h>

+ Inheritance diagram for MusicAnimationStackedWidget:

Public Types

enum  Module { Module::LeftToRight, Module::RightToLeft, Module::TopToBottom, Module::BottomToTop }
 

Public Member Functions

 MusicAnimationStackedWidget (QWidget *parent=nullptr)
 
 ~MusicAnimationStackedWidget ()
 
void start (int index)
 
void setIndex (int previous, int current)
 
void setLength (int length, Module type)
 
int previousIndex () const
 
int currentIndex () const
 
void setDuration (int duration)
 
int duration () const
 

Private Slots

void valueChanged (const QVariant &value)
 
void animationFinished ()
 

Private Member Functions

virtual void paintEvent (QPaintEvent *event) overridefinal
 
void renderPreviousWidget (QPainter *painter)
 
void renderCurrentWidget (QPainter *painter)
 

Private Attributes

bool m_isAnimating
 
float m_currentValue
 
int m_currentIndex
 
int m_previousIndex
 
Module m_type
 
QPropertyAnimation * m_animation
 

Detailed Description

The class of the statckwidget switch animation.

Author
Greedysky greed.nosp@m.ysky.nosp@m.@163..nosp@m.com

Definition at line 29 of file musicanimationstackedwidget.h.

Member Enumeration Documentation

Enumerator
LeftToRight 

Animation from left to right

RightToLeft 

Animation from right to left

TopToBottom 

Animation from top to bottom

BottomToTop 

Animation from bottom to top

Definition at line 34 of file musicanimationstackedwidget.h.

Constructor & Destructor Documentation

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

Object constructor.

Definition at line 5 of file musicanimationstackedwidget.cpp.

References animationFinished(), m_animation, and valueChanged().

MusicAnimationStackedWidget::~MusicAnimationStackedWidget ( )

Object destructor.

Definition at line 23 of file musicanimationstackedwidget.cpp.

References m_animation.

Member Function Documentation

void MusicAnimationStackedWidget::animationFinished ( )
privateslot

Animation finished.

Definition at line 179 of file musicanimationstackedwidget.cpp.

References m_currentIndex, m_currentValue, and m_isAnimating.

Referenced by MusicAnimationStackedWidget().

int MusicAnimationStackedWidget::currentIndex ( ) const

Get current index.

Definition at line 158 of file musicanimationstackedwidget.cpp.

References m_currentIndex.

int MusicAnimationStackedWidget::duration ( ) const

Get animation duration.

Definition at line 168 of file musicanimationstackedwidget.cpp.

References m_animation.

void MusicAnimationStackedWidget::paintEvent ( QPaintEvent *  event)
finaloverrideprivatevirtual

Override the widget event.

Definition at line 28 of file musicanimationstackedwidget.cpp.

References m_isAnimating, renderCurrentWidget(), and renderPreviousWidget().

int MusicAnimationStackedWidget::previousIndex ( ) const

Get previoud index.

Definition at line 153 of file musicanimationstackedwidget.cpp.

References m_previousIndex.

void MusicAnimationStackedWidget::renderCurrentWidget ( QPainter *  painter)
private

Render current widget.

Definition at line 61 of file musicanimationstackedwidget.cpp.

References BottomToTop, LeftToRight, m_currentIndex, m_currentValue, m_type, RightToLeft, and TopToBottom.

Referenced by paintEvent().

void MusicAnimationStackedWidget::renderPreviousWidget ( QPainter *  painter)
private

Render previous widget.

Definition at line 42 of file musicanimationstackedwidget.cpp.

References BottomToTop, LeftToRight, m_previousIndex, m_type, RightToLeft, and TopToBottom.

Referenced by paintEvent().

void MusicAnimationStackedWidget::setDuration ( int  duration)

Set animation duration.

Definition at line 163 of file musicanimationstackedwidget.cpp.

References m_animation.

void MusicAnimationStackedWidget::setIndex ( int  previous,
int  current 
)

Set previoud and current index.

Definition at line 125 of file musicanimationstackedwidget.cpp.

References m_currentIndex, and m_previousIndex.

void MusicAnimationStackedWidget::setLength ( int  length,
Module  type 
)

Set animation start and end pos distance and animation type.

Definition at line 131 of file musicanimationstackedwidget.cpp.

References BottomToTop, LeftToRight, m_animation, m_type, RightToLeft, and TopToBottom.

void MusicAnimationStackedWidget::start ( int  index)
void MusicAnimationStackedWidget::valueChanged ( const QVariant &  value)
privateslot

Animation value changed.

Definition at line 173 of file musicanimationstackedwidget.cpp.

References m_currentValue.

Referenced by MusicAnimationStackedWidget().

Member Data Documentation

QPropertyAnimation* MusicAnimationStackedWidget::m_animation
private
int MusicAnimationStackedWidget::m_currentIndex
private
float MusicAnimationStackedWidget::m_currentValue
private
bool MusicAnimationStackedWidget::m_isAnimating
private

Definition at line 105 of file musicanimationstackedwidget.h.

Referenced by animationFinished(), paintEvent(), and start().

int MusicAnimationStackedWidget::m_previousIndex
private
Module MusicAnimationStackedWidget::m_type
private

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