TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicsmoothmovingwidget.h
Go to the documentation of this file.
1 #ifndef MUSICSMOOTHMOVINGWIDGET_H
2 #define MUSICSMOOTHMOVINGWIDGET_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 <QScrollArea>
24 
25 class QPropertyAnimation;
26 
31 {
32  Q_OBJECT
34 public:
38  explicit MusicSmoothMovingTableWidget(QWidget *parent = nullptr);
43 
47  void setMovedScrollBar(QScrollBar *bar = nullptr);
48 
49 public Q_SLOTS:
53  void timeToAnimation();
57  void valueChanged(int value);
58 
59 protected:
63  virtual void wheelEvent(QWheelEvent *event) override;
64 
66  int m_previousValue, m_deltaValue;
67  QScrollBar *m_scrollBar;
69  QPropertyAnimation *m_slowAnimation;
70 
71 };
72 
73 
78 {
79  Q_OBJECT
81 public:
85  explicit MusicSmoothMovingScrollArea(QWidget *parent = nullptr);
90 
94  void setMovedScrollBar(QScrollBar *bar = nullptr);
95 
96 public Q_SLOTS:
100  void timeToAnimation();
104  void valueChanged(int value);
105 
106 private:
110  virtual void wheelEvent(QWheelEvent *event) override final;
111 
113  int m_previousValue, m_deltaValue;
114  QScrollBar *m_scrollBar;
116  QPropertyAnimation *m_slowAnimation;
117 
118 };
119 
120 #endif // MUSICSMOOTHMOVINGWIDGET_H
#define TTK_MODULE_EXPORT
The class of the table widget base.
The class of the slider smooth moving scroll area widget.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
The class of the slider smooth moving table widget.