TTKMusicPlayer  4.3.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 - 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 <QGridLayout>
24 
28 class TTK_MODULE_EXPORT MusicLrcPhotoItem : public QLabel
29 {
30  Q_OBJECT
31 public:
35  explicit MusicLrcPhotoItem(QWidget *parent = nullptr);
36 
40  void updatePixmap(const QString &path);
41 
45  void setSelected(bool v) noexcept;
49  inline bool isSelected() const noexcept { return m_isSelected; }
50 
54  inline QString path() const noexcept { return m_path; }
58  inline QString& pathRef() noexcept { return m_path; }
59 
60 private:
64  virtual void mousePressEvent(QMouseEvent *event) override final;
65  virtual void paintEvent(QPaintEvent *event) override final;
66 
67  QString m_path;
69 
70 };
71 
72 
76 class TTK_MODULE_EXPORT MusicLrcPhotoWidget : public QWidget
77 {
78  Q_OBJECT
79 public:
83  explicit MusicLrcPhotoWidget(QWidget *parent = nullptr);
88 
92  void addCellItem(const QString &path);
93 
94 public Q_SLOTS:
98  void addButtonClicked();
102  void deleteButtonClicked();
106  void exportButtonClicked();
107 
108 private:
112  void initialize();
116  bool isValid() const;
117 
118  QGridLayout *m_gridLayout;
119  QList<MusicLrcPhotoItem*> m_items;
120 
121 };
122 
123 
124 namespace Ui {
126 }
127 
132 {
133  Q_OBJECT
134 public:
138  explicit MusicLrcPhotoManagerWidget(QWidget *parent = nullptr);
143 
144 private:
145  Ui::MusicLrcPhotoManagerWidget *m_ui;
146 
148 
149 };
150 
151 #endif // MUSICLRCPHOTOMANAGERWIDGET_H
#define TTK_MODULE_EXPORT
The class of the lrc photo widget.
The class of the lrc art photo upload.
bool isValid(const QString &data)
Definition: qdlna.cpp:76
QString path() const noexcept
bool isSelected() const noexcept
The class of the lrc photo pixmap item.
QList< MusicLrcPhotoItem * > m_items
QString & pathRef() noexcept
TTK_MODULE_EXPORT void initialize(TTK::Attribute attr)
The class of the moving dialog base.
Ui::MusicLrcPhotoManagerWidget * m_ui
#define const
Definition: zconf.h:233