TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiclrcphotomanagerwidget.h
Go to the documentation of this file.
1 #ifndef MUSICLRCPHOTOMANAGERWIDGET_H
2 #define MUSICLRCPHOTOMANAGERWIDGET_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 <QGridLayout>
24 
28 class TTK_MODULE_EXPORT MusicLrcPhotoItem : public QLabel
29 {
30  Q_OBJECT
32 public:
36  explicit MusicLrcPhotoItem(QWidget *parent = nullptr);
37 
41  void updatePixmap(const QString &path);
42 
46  void setSelected(bool v);
50  inline bool isSelected() const { return m_isSelected; }
51 
55  inline QString path() const { return m_path; }
59  inline QString& pathRef() { return m_path; }
60 
61 private:
65  virtual void mousePressEvent(QMouseEvent *event) override final;
66  virtual void paintEvent(QPaintEvent *event) override final;
67 
68  QString m_path;
70 
71 };
72 
73 
77 class TTK_MODULE_EXPORT MusicLrcPhotoWidget : public QWidget
78 {
79  Q_OBJECT
81 public:
85  explicit MusicLrcPhotoWidget(QWidget *parent = nullptr);
90 
94  void addCellItem(const QString &path);
95 
96 public Q_SLOTS:
100  void addButtonClicked();
104  void deleteButtonClicked();
108  void exportButtonClicked();
109 
110 private:
114  void initialize();
118  bool isValid() const;
119 
120  QGridLayout *m_gridLayout;
121  QList<MusicLrcPhotoItem*> m_items;
122 
123 };
124 
125 
126 namespace Ui {
128 }
129 
134 {
135  Q_OBJECT
137 public:
141  explicit MusicLrcPhotoManagerWidget(QWidget *parent = nullptr);
146 
147 private:
148  Ui::MusicLrcPhotoManagerWidget *m_ui;
149 
151 
152 };
153 
154 #endif // MUSICLRCPHOTOMANAGERWIDGET_H
#define TTK_MODULE_EXPORT
The class of the lrc photo widget.
The class of the lrc art photo upload.
The class of the lrc photo pixmap item.
QList< MusicLrcPhotoItem * > m_items
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
The class of the moving dialog base.
Ui::MusicLrcPhotoManagerWidget * m_ui