TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicabstractitemquerywidget.h
Go to the documentation of this file.
1 #ifndef MUSICABSTRACTITEMQUERYWIDGET_H
2 #define MUSICABSTRACTITEMQUERYWIDGET_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 <QButtonGroup>
23 #include "musicwidgetheaders.h"
24 #include "musicimagerenderer.h"
25 #include "musicsongsharingwidget.h"
27 
28 #define QUERY_WIDGET_WIDTH (G_SETTING_PTR->value(MusicSettingManager::WidgetSize).toSize().width() - LEFT_SIDE_WIDTH_MIN)
29 
34 {
35  Q_OBJECT
36 public:
40  explicit MusicAbstractItemQueryWidget(QWidget *parent = nullptr);
45 
49  virtual void setCurrentValue(const QString &value);
53  virtual void setCurrentKey(const QString &id);
54 
55 public Q_SLOTS:
59  void downloadFinished(const QByteArray &bytes);
63  void playAllButtonClicked();
67  void shareButtonClicked();
71  void playButtonClicked();
75  void downloadButtonClicked();
79  void addButtonClicked();
80 
81 protected:
85  virtual void mousePressEvent(QMouseEvent *event) override final;
86  virtual void mouseMoveEvent(QMouseEvent *event) override final;
87  virtual void mouseReleaseEvent(QMouseEvent *event) override final;
91  void removeItems(QLayout *layout);
95  void createFirstWidget();
99  void createSecondWidget();
103  void setSongCountText();
104 
105  QString m_value;
106  QWidget *m_mainWidget;
107  QPushButton *m_songButton;
108  QLabel *m_iconLabel, *m_statusLabel, *m_infoLabel;
109  QStackedWidget *m_container;
114 
115  struct Data
116  {
117  QLabel *m_label;
118  QFont m_font;
119  };
120  QList<Data> m_resizeWidgets;
121 
122 };
123 
124 #endif // MusicAbstractItemQueryWidget_H
#define TTK_MODULE_EXPORT
The class of the search result data item.
The class of the query item table widget.
The class of the widget resize interface.
The class of the item query widget base.
MusicAbstractQueryRequest * m_networkRequest
MusicItemQueryTableWidget * m_tableWidget
The class of the abstract query data from net.
MusicSongSharingWidget::Module m_shareType