2022-08-25 18:37:24 +08:00
|
|
|
#ifndef PAGELISTITEM_H
|
|
|
|
#define PAGELISTITEM_H
|
|
|
|
|
2023-05-09 15:08:39 +08:00
|
|
|
#include <QGraphicsScene>
|
2022-08-25 18:37:24 +08:00
|
|
|
#include <QJsonObject>
|
2023-05-09 15:08:39 +08:00
|
|
|
#include <QLabel>
|
2022-08-25 18:37:24 +08:00
|
|
|
#include <QListWidget>
|
|
|
|
|
|
|
|
class PageListItem : public QObject, public QListWidgetItem {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit PageListItem(const QJsonObject &attr, const QString &pageDir);
|
|
|
|
~PageListItem() {
|
2023-05-09 15:08:39 +08:00
|
|
|
if(mAttrWgt) delete mAttrWgt;
|
2022-08-25 18:37:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void updateJson();
|
|
|
|
bool saveFiles();
|
|
|
|
QWidget *itemWgt();
|
|
|
|
QWidget *attrWgt();
|
|
|
|
|
|
|
|
QJsonObject mAttr;
|
|
|
|
QString mPageDir;
|
|
|
|
QWidget *mAttrWgt{0};
|
|
|
|
QListWidget *mAudiosList{0};
|
|
|
|
QGraphicsScene *mScene{0};
|
|
|
|
QGraphicsView *mGraView{0};
|
|
|
|
QLabel *fdPlayTimes{0};
|
|
|
|
};
|
|
|
|
|
|
|
|
struct AudioInfo {
|
|
|
|
QString dir;
|
|
|
|
QString name;
|
|
|
|
int dur{0};
|
|
|
|
int vol{100};
|
|
|
|
};
|
|
|
|
Q_DECLARE_METATYPE(AudioInfo)
|
|
|
|
|
|
|
|
#endif // PAGELISTITEM_H
|