TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiclayoutanimationwidget.h
Go to the documentation of this file.
1 #ifndef MUSICLAYOUTANIMATIONWIDGET_H
2 #define MUSICLAYOUTANIMATIONWIDGET_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Music Player project
6  * Copyright (C) 2015 - 2026 Greedysky Studio
7 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17 
18  * You should have received a copy of the GNU General Public License along
19  * with this program; If not, see <http://www.gnu.org/licenses/>.
20  ***************************************************************************/
21 
22 #include <QWidget>
23 #include "musicglobaldefine.h"
24 
25 class QBoxLayout;
26 class QPropertyAnimation;
27 
32 {
33  Q_OBJECT
34 public:
38  explicit MusicLayoutAnimationWidget(QWidget *parent = nullptr);
43 
47  virtual void start();
51  void stop();
52 
56  void connectTo(QObject *parent);
60  void addStretch(int stretch = 0);
64  void addWidget(QWidget *widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
68  void removeWidget(QWidget *widget);
69 
70 private Q_SLOTS:
74  void valueChanged(const QVariant &value);
78  void animationFinished();
79 
80 protected:
83  QWidget *m_mainWidget;
84  QBoxLayout *m_widgetLayout;
85  QPropertyAnimation *m_animation;
86 
87 };
88 
89 
94 {
95  Q_OBJECT
96 public:
100  explicit MusicVLayoutAnimationWidget(QWidget *parent = nullptr);
101 
105  virtual void start() override final;
106 
107 private:
111  virtual void paintEvent(QPaintEvent *event) override final;
112 
113 };
114 
115 
120 {
121  Q_OBJECT
122 public:
126  explicit MusicHLayoutAnimationWidget(QWidget *parent = nullptr);
127 
131  virtual void start() override final;
132 
133 private:
137  virtual void paintEvent(QPaintEvent *event) override final;
138 
139 };
140 
141 #endif // MUSICLAYOUTANIMATIONWIDGET_H
#define TTK_MODULE_EXPORT
The class of the horizontal layout float animation widget.
The class of the layout float animation widget.
The class of the vertical layout float animation widget.