TTKMusicPlayer  4.2.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 - 2025 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 MusicSmoothMovingInterface(QObject *parent = nullptr);
43 
47  void setScrollBar(QScrollBar *bar);
51  inline QScrollBar* scrollBar() const noexcept { return m_scrollBar; }
52 
56  void updateValue(int value);
57 
58 public Q_SLOTS:
62  void timeToAnimation();
66  void valueChanged(int value);
67 
68 private:
70  int m_previousValue, m_deltaValue;
71  QScrollBar *m_scrollBar;
73  QPropertyAnimation *m_moveAnimation;
74 
75 };
76 
77 
78 
79 
84 {
85  Q_OBJECT
87 public:
91  explicit MusicSmoothMovingTableWidget(QWidget *parent = nullptr);
92 
96  void setMovedScrollBar(QScrollBar *bar = nullptr);
97 
98 protected:
102  virtual void wheelEvent(QWheelEvent *event) override;
103 
107  inline QScrollBar* scrollBar() const noexcept { return m_interface.scrollBar(); }
108 
109 private:
111 
112 };
113 
114 
119 {
120  Q_OBJECT
122 public:
126  explicit MusicSmoothMovingScrollArea(QWidget *parent = nullptr);
127 
131  void setMovedScrollBar(QScrollBar *bar = nullptr);
132 
133 protected:
137  virtual void wheelEvent(QWheelEvent *event) override;
138 
139 private:
141 
142 };
143 
144 #endif // MUSICSMOOTHMOVINGWIDGET_H
#define TTK_MODULE_EXPORT
The class of the slider smooth moving interface.
The class of the table widget base.
MusicSmoothMovingInterface m_interface
The class of the slider smooth moving scroll area widget.
QPropertyAnimation * m_moveAnimation
MusicSmoothMovingInterface m_interface
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:164
The class of the slider smooth moving table widget.
QScrollBar * scrollBar() const noexcept
#define const
Definition: zconf.h:233
QScrollBar * scrollBar() const noexcept