TTKMusicPlayer
4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
|
The class of the statckwidget switch animation. More...
#include <musicanimationstackedwidget.h>
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 |
The class of the statckwidget switch animation.
Definition at line 29 of file musicanimationstackedwidget.h.
|
strong |
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.
|
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.
|
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.
|
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.
|
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().
|
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.
Set previoud and current index.
Definition at line 125 of file musicanimationstackedwidget.cpp.
References m_currentIndex, and m_previousIndex.
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 | ) |
Start to anmiation by index.
Definition at line 100 of file musicanimationstackedwidget.cpp.
References m_animation, m_currentIndex, m_isAnimating, and m_previousIndex.
Referenced by MusicConnectLocalWidget::changeStatckedWidgetFirst(), and MusicConnectLocalWidget::changeStatckedWidgetSecond().
|
privateslot |
Animation value changed.
Definition at line 173 of file musicanimationstackedwidget.cpp.
References m_currentValue.
Referenced by MusicAnimationStackedWidget().
|
private |
Definition at line 109 of file musicanimationstackedwidget.h.
Referenced by duration(), MusicAnimationStackedWidget(), setDuration(), setLength(), start(), and ~MusicAnimationStackedWidget().
|
private |
Definition at line 107 of file musicanimationstackedwidget.h.
Referenced by animationFinished(), currentIndex(), renderCurrentWidget(), setIndex(), and start().
|
private |
Definition at line 106 of file musicanimationstackedwidget.h.
Referenced by animationFinished(), renderCurrentWidget(), and valueChanged().
|
private |
Definition at line 105 of file musicanimationstackedwidget.h.
Referenced by animationFinished(), paintEvent(), and start().
|
private |
Definition at line 107 of file musicanimationstackedwidget.h.
Referenced by previousIndex(), renderPreviousWidget(), setIndex(), and start().
|
private |
Definition at line 108 of file musicanimationstackedwidget.h.
Referenced by renderCurrentWidget(), renderPreviousWidget(), and setLength().