2022-08-25 18:37:24 +08:00
|
|
|
#ifndef PAGELISTITEM_H
|
|
|
|
#define PAGELISTITEM_H
|
|
|
|
|
2023-10-23 14:58:29 +08:00
|
|
|
#include "gutil/qjson.h"
|
2023-05-09 15:08:39 +08:00
|
|
|
#include <QGraphicsScene>
|
|
|
|
#include <QLabel>
|
2022-08-25 18:37:24 +08:00
|
|
|
#include <QListWidget>
|
2023-10-23 14:58:29 +08:00
|
|
|
#include <QPushButton>
|
|
|
|
#include <QTimeEdit>
|
2022-08-25 18:37:24 +08:00
|
|
|
|
|
|
|
class PageListItem : public QObject, public QListWidgetItem {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-10-23 14:58:29 +08:00
|
|
|
explicit PageListItem(const JObj &attr, const QString &pageDir);
|
2022-08-25 18:37:24 +08:00
|
|
|
~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();
|
|
|
|
|
2023-10-23 14:58:29 +08:00
|
|
|
JObj mAttr;
|
2022-08-25 18:37:24 +08:00
|
|
|
QString mPageDir;
|
|
|
|
QWidget *mAttrWgt{0};
|
|
|
|
QListWidget *mAudiosList{0};
|
|
|
|
QGraphicsScene *mScene{0};
|
|
|
|
QGraphicsView *mGraView{0};
|
2023-06-20 08:49:01 +08:00
|
|
|
QLabel *fdIdx{0}, *fdPlayTimes{0};
|
2023-06-20 16:09:25 +08:00
|
|
|
qreal scale{1};
|
|
|
|
int viewW{120}, viewH{80};
|
2022-08-25 18:37:24 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct AudioInfo {
|
|
|
|
QString dir;
|
|
|
|
QString name;
|
|
|
|
int dur{0};
|
|
|
|
int vol{100};
|
|
|
|
};
|
|
|
|
Q_DECLARE_METATYPE(AudioInfo)
|
|
|
|
|
2023-10-23 14:58:29 +08:00
|
|
|
class PlanItemWgt : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit PlanItemWgt(QListWidgetItem *item, const JObj * = 0);
|
|
|
|
|
|
|
|
QLabel *fdIdx;
|
|
|
|
QListWidgetItem *m_item;
|
|
|
|
|
|
|
|
QTimeEdit *tStart;
|
|
|
|
QTimeEdit *tEnd;
|
|
|
|
QPushButton *bnDel;
|
|
|
|
QPushButton *btnDays[7];
|
|
|
|
signals:
|
|
|
|
void sigItemChanged();
|
|
|
|
};
|
|
|
|
|
2022-08-25 18:37:24 +08:00
|
|
|
#endif // PAGELISTITEM_H
|