TTKMusicPlayer  3.7.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 - 2024 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
35 public:
39  explicit MusicLayoutAnimationWidget(QWidget *parent = nullptr);
44 
48  virtual void start();
52  void stop();
53 
57  void connectTo(QObject *parent);
61  void addStretch(int stretch = 0);
65  void addWidget(QWidget *widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
69  void removeWidget(QWidget *widget);
70 
71 private Q_SLOTS:
75  void valueChanged(const QVariant &value);
79  void animationFinished();
80 
81 protected:
84  QWidget *m_mainWidget;
85  QBoxLayout *m_widgetLayout;
86  QPropertyAnimation *m_animation;
87 
88 };
89 
90 
95 {
96  Q_OBJECT
98 public:
102  explicit MusicVLayoutAnimationWidget(QWidget *parent = nullptr);
103 
107  virtual void start() override final;
108 
109 private:
113  virtual void paintEvent(QPaintEvent *event) override final;
114 
115 };
116 
117 
122 {
123  Q_OBJECT
125 public:
129  explicit MusicHLayoutAnimationWidget(QWidget *parent = nullptr);
130 
134  virtual void start() override final;
135 
136 private:
140  virtual void paintEvent(QPaintEvent *event) override final;
141 
142 };
143 
144 #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.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152