TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiccommentswidget.h
Go to the documentation of this file.
1 #ifndef MUSICCOMMENTSWIDGET_H
2 #define MUSICCOMMENTSWIDGET_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 <QLabel>
23 #include "musiccommentsrequest.h"
24 
25 class QTextEdit;
27 
31 class TTK_MODULE_EXPORT MusicCommentsItem : public QWidget
32 {
33  Q_OBJECT
35 public:
39  explicit MusicCommentsItem(QWidget *parent = nullptr);
44 
48  void addCellItem(const MusicResultDataItem &item);
49 
50 private Q_SLOTS:
54  void downLoadFinished(const QByteArray &bytes);
55 
56 private:
57  QTextEdit *m_userCommit;
58  QLabel *m_userName, *m_timerLabel;
59  QLabel *m_iconLabel, *m_starLabel;
60 
61 };
62 
63 
68 {
69  Q_OBJECT
71 public:
75  explicit MusicCommentsWidget(QWidget *parent = nullptr);
80 
84  virtual void initialize(bool isPain);
88  void setCurrentSongName(const QString &name);
89 
90 public Q_SLOTS:
94  void createCommentItem(const MusicResultDataItem &item);
98  void buttonClicked(int index);
102  void createEMOJILabelWidget();
106  void currentEMOJIchanged(const QString &data);
107 
108 protected:
112  virtual void mousePressEvent(QMouseEvent *event) override final;
113  virtual void mouseMoveEvent(QMouseEvent *event) override final;
114  virtual void mouseReleaseEvent(QMouseEvent *event) override final;
118  void initLabel(const QString &name, int total);
122  void deleteCommentsItems();
126  void createPageWidget();
127 
128  bool m_isPain;
129  QTextEdit *m_messageEdit;
130  QLabel *m_topLabel, *m_commentsLabel;
133  QList<MusicCommentsItem*> m_commentsItems;
135 
136 };
137 
138 #endif // MUSICCOMMENTSWIDGET_H
#define TTK_MODULE_EXPORT
The class of the song comment widget.
The class of the search result data item.
The class of the song comment item.
QList< MusicCommentsItem * > m_commentsItems
const char * name
Definition: http_parser.c:458
The class of the query song comments download data from net.
The class of the page query widget.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
MusicCommentsRequest * m_networkRequest
MusicPageQueryWidget * m_pageQueryWidget