TTKMusicPlayer  4.3.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 - 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 <QScrollArea>
24 
25 class QPropertyAnimation;
26 
31 {
32  Q_OBJECT
33 public:
37  explicit MusicSmoothMovingInterface(QObject *parent = nullptr);
42 
46  void setScrollBar(QScrollBar *bar);
50  inline QScrollBar* scrollBar() const noexcept { return m_scrollBar; }
51 
55  void updateValue(int value);
56 
57 public Q_SLOTS:
61  void timeToAnimation();
65  void valueChanged(int value);
66 
67 private:
69  int m_previousValue, m_deltaValue;
70  QScrollBar *m_scrollBar;
72  QPropertyAnimation *m_moveAnimation;
73 
74 };
75 
76 
77 
78 
83 {
84  Q_OBJECT
85 public:
89  explicit MusicSmoothMovingTableWidget(QWidget *parent = nullptr);
90 
94  void setMovedScrollBar(QScrollBar *bar = nullptr);
95 
96 protected:
100  virtual void wheelEvent(QWheelEvent *event) override;
101 
105  inline QScrollBar* scrollBar() const noexcept { return m_interface.scrollBar(); }
106 
107 private:
109 
110 };
111 
112 
117 {
118  Q_OBJECT
119 public:
123  explicit MusicSmoothMovingScrollArea(QWidget *parent = nullptr);
124 
128  void setMovedScrollBar(QScrollBar *bar = nullptr);
129 
130 protected:
134  virtual void wheelEvent(QWheelEvent *event) override;
135 
136 private:
138 
139 };
140 
141 #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
The class of the slider smooth moving table widget.
QScrollBar * scrollBar() const noexcept
#define const
Definition: zconf.h:233
QScrollBar * scrollBar() const noexcept