TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicqueryitemwidget.h
Go to the documentation of this file.
1 #ifndef MUSICQUERYITEMWIDGET_H
2 #define MUSICQUERYITEMWIDGET_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 "ttkclickedlabel.h"
23 #include "musicresultinfo.h"
25 
26 class QPushButton;
27 
32 {
33  Q_OBJECT
34 public:
35  static constexpr int WIDTH_LABEL_SIZE = 150;
36  static constexpr int HEIGHT_LABEL_SIZE = 200;
37  static constexpr int LINE_SPACING_SIZE = 150;
38 
39 public:
43  explicit MusicSquareQueryItemWidget(QWidget *parent = nullptr);
48 
52  inline void setShowTime(bool v) noexcept { m_showTime = v; }
56  inline void setShowCount(bool v) noexcept { m_showCount = v; }
60  inline void setValueLabel(bool v) noexcept { m_valueLabel->setVisible(v); }
61 
65  void setResultDataItem(const MusicResultDataItem &item, MusicCoverRequest *cover);
66 
67 Q_SIGNALS:
71  void currentItemClicked(const MusicResultDataItem &item);
72 
73 public Q_SLOTS:
77  void downloadFinished(const QByteArray &bytes);
81  void renderFinished(const QPixmap &data);
85  void itemClicked();
86 
87 private:
88  bool m_showTime, m_showCount;
90  QLabel *m_nameLabel, *m_valueLabel;
91  QPushButton *m_listenButton, *m_playButton;
93 
94 };
95 
96 
101 {
102  Q_OBJECT
103 public:
104  static constexpr int WIDTH_LABEL_SIZE = 150;
105  static constexpr int HEIGHT_LABEL_SIZE = 100;
106  static constexpr int LINE_SPACING_SIZE = 150;
107 
108 public:
112  explicit MusicRectQueryItemWidget(QWidget *parent = nullptr);
117 
121  void setResultDataItem(const MusicResultDataItem &item);
122 
123 Q_SIGNALS:
127  void currentItemClicked(const MusicResultDataItem &item);
128 
129 public Q_SLOTS:
133  void downloadFinished(const QByteArray &bytes);
137  void renderFinished(const QPixmap &data);
141  void itemClicked();
142 
143 private:
147  virtual void enterEvent(QtEnterEvent *event) override final;
148  virtual void leaveEvent(QEvent *event) override final;
149 
151  QLabel *m_nameLabel;
152  QPushButton *m_playButton;
154 
155 };
156 
157 
162 {
163  Q_OBJECT
164 public:
165  static constexpr int WIDTH_LABEL_SIZE = 60;
166  static constexpr int HEIGHT_LABEL_SIZE = 105;
167  static constexpr int LINE_SPACING_SIZE = 105;
168 
169 public:
173  explicit MusicLabelQueryItemWidget(QWidget *parent = nullptr);
178 
182  void setResultDataItem(const MusicResultDataItem &item);
183 
184 Q_SIGNALS:
188  void currentItemClicked(const MusicResultDataItem &item);
189 
190 public Q_SLOTS:
194  void downloadFinished(const QByteArray &bytes);
198  void itemClicked();
199 
200 private:
202  QLabel *m_iconLabel, *m_nameLabel;
203 
204 };
205 
206 
211 {
212  Q_OBJECT
213 public:
214  static constexpr int WIDTH_LABEL_SIZE = 150;
215  static constexpr int HEIGHT_LABEL_SIZE = 25;
216  static constexpr int LINE_SPACING_SIZE = 150;
217 
218 public:
222  explicit MusicTextQueryItemWidget(QWidget *parent = nullptr);
223 
227  void setResultDataItem(const MusicResultDataItem &item);
228 
229 Q_SIGNALS:
233  void currentItemClicked(const MusicResultDataItem &item);
234 
235 public Q_SLOTS:
239  void itemClicked();
240 
241 private:
243 
244 };
245 
246 #endif // MUSICQUERYITEMWIDGET_H
#define QtEnterEvent
Event enter.
Definition: ttkqtcompat.h:178
#define TTK_MODULE_EXPORT
The class of the search result data item.
void setValueLabel(bool v) noexcept
MusicResultDataItem m_itemData
The class of the label query item widget.
MusicResultDataItem m_itemData
The class of the label widget that can click.
MusicResultDataItem m_itemData
The class of the rect query item widget.
void setShowTime(bool v) noexcept
static constexpr int LINE_SPACING_SIZE
The class of the text query item widget.
void setShowCount(bool v) noexcept
MusicResultDataItem m_itemData
The class of the cover data download request.
The class of the square query item widget.