TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicfuntionanimationwidget.h
Go to the documentation of this file.
1 #ifndef MUSICFUNTIONANIMATIONWIDGET_H
2 #define MUSICFUNTIONANIMATIONWIDGET_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 
24 #include "musicglobaldefine.h"
25 
26 class QButtonGroup;
27 class QPropertyAnimation;
28 
33 {
34  Q_OBJECT
36 public:
40  explicit MusicBackgroundWidget(QWidget *parent = nullptr);
41 
45  void backgroundTransparent(int value);
46 
47 private:
51  virtual void paintEvent(QPaintEvent *event) override final;
52 
54 
55 };
56 
57 
62 {
63  Q_OBJECT
65 public:
69  explicit MusicLineBackgroundWidget(QWidget *parent = nullptr);
70 
74  void transparent(bool state);
75 
76 private:
80  virtual void paintEvent(QPaintEvent *event) override final;
81 
83 
84 };
85 
86 
91 {
92  Q_OBJECT
94 public:
98  explicit MusicAbstractAnimationWidget(QWidget *parent = nullptr);
103 
104 Q_SIGNALS:
108  void buttonClicked(int index);
109 
110 public Q_SLOTS:
114  virtual void switchToSelectedItemStyle(int index);
118  void animationChanged(const QVariant &value);
122  void finished();
123 
124 protected:
128  virtual void paintEvent(QPaintEvent *event) override;
129 
130  QPixmap m_pix;
131  int m_curIndex, m_preIndex, m_x;
132  float m_perWidth, m_totalWidth;
133  bool m_isAnimation, m_showState, m_showLine;
134 
135  QPropertyAnimation *m_animation;
136  QWidgetList m_container;
137  QButtonGroup *m_buttonGroup;
138 
139 };
140 
141 
146 {
147  Q_OBJECT
149 public:
153  explicit MusicFuntionAnimationWidget(QWidget *parent = nullptr);
154 
155 public Q_SLOTS:
159  virtual void switchToSelectedItemStyle(int index) override final;
160 
161 private:
165  virtual void paintEvent(QPaintEvent *event) override final;
166 
167 };
168 
169 
174 {
175  Q_OBJECT
177 public:
181  explicit MusicOptionAnimationWidget(QWidget *parent = nullptr);
182 
186  void buttonStyleClear(bool fore);
190  void buttonStyleSwitch(int index);
191 
192 public Q_SLOTS:
196  virtual void switchToSelectedItemStyle(int index) override final;
197 
198 private:
202  virtual void paintEvent(QPaintEvent *event) override final;
203 
204 };
205 
206 
211 {
212  Q_OBJECT
214 public:
218  explicit MusicSkinAnimationWidget(QWidget *parent = nullptr);
219 
220 public Q_SLOTS:
224  virtual void switchToSelectedItemStyle(int index) override final;
225 
226 private:
230  virtual void paintEvent(QPaintEvent *event) override final;
231 
232 };
233 
234 #endif // MUSICFUNTIONANIMATIONWIDGET_H
#define TTK_MODULE_EXPORT
The class of the function animation widget.
virtual void paintEvent(QPaintEvent *event) override
The class of the background widget.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
virtual void switchToSelectedItemStyle(int index)
The class of the line background widget.
The class of the function skin animation widget.
The class of the animation base widget.
state
Definition: http_parser.c:279
The class of the function option animation widget.