2022-09-30 18:08:39 +08:00
|
|
|
#ifndef PROGITEM_H
|
|
|
|
#define PROGITEM_H
|
|
|
|
|
|
|
|
#include <QTreeWidget>
|
|
|
|
#include <QTreeWidgetItem>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QJsonObject>
|
|
|
|
#include <QJsonDocument>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <base/loqtreewidget.h>
|
2022-10-27 15:07:45 +08:00
|
|
|
class ProgPanel;
|
|
|
|
class ProgItem : public QObject, public QTreeWidgetItem {
|
2022-09-30 18:08:39 +08:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-04-18 14:14:46 +08:00
|
|
|
explicit ProgItem(const QString &progsDir, const QString &name, int w, int h, const QString & remarks, QList<int> &splitWidths, int, LoQTreeWidget *parent = nullptr, ProgPanel *pWnd=nullptr);
|
2022-10-27 15:07:45 +08:00
|
|
|
explicit ProgItem(const QString &progsDir, const QJsonObject &json, LoQTreeWidget *parent = nullptr, ProgPanel *pWnd=nullptr);
|
2022-09-30 18:08:39 +08:00
|
|
|
|
|
|
|
void save();
|
|
|
|
void del();
|
|
|
|
void refreshLable();
|
|
|
|
|
2022-10-27 15:07:45 +08:00
|
|
|
QString mName;
|
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
|
|
|
QString mRemark;
|
2023-04-18 14:14:46 +08:00
|
|
|
QList<int> mSplitWidths;
|
|
|
|
int mMaxWidth{0};
|
2022-10-27 15:07:45 +08:00
|
|
|
QString mProgsDir;
|
|
|
|
QString mProgDir;
|
|
|
|
qint64 m_fsize{0};
|
2022-09-30 18:08:39 +08:00
|
|
|
QDateTime m_last;
|
|
|
|
QPushButton *m_bnName;
|
2022-10-27 15:07:45 +08:00
|
|
|
ProgPanel *mProgPanel{0};
|
2022-09-30 18:08:39 +08:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void onSetProgram();
|
|
|
|
void onSendProgram();
|
|
|
|
void onUsbExportProgram();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void init();
|
|
|
|
QPushButton *m_bnExport;
|
|
|
|
QPushButton *m_bnSend;
|
|
|
|
QString m_orgName;
|
2022-10-27 15:07:45 +08:00
|
|
|
LoQTreeWidget *mTree;
|
2022-09-30 18:08:39 +08:00
|
|
|
};
|
|
|
|
enum ENUM_PROGRAMLISTHEADERITEM
|
|
|
|
{
|
|
|
|
ENUM_PROGRAMLISTHEADERITEM_CHECK=0,
|
|
|
|
ENUM_PROGRAMLISTHEADERITEM_NAME,
|
|
|
|
ENUM_PROGRAMLISTHEADERITEM_RESOLUTION,
|
|
|
|
ENUM_PROGRAMLISTHEADERITEM_SIZE,
|
|
|
|
ENUM_PROGRAMLISTHEADERITEM_LASTTIME,
|
|
|
|
ENUM_PROGRAMLISTHEADERITEM_USB_EXPORT,
|
|
|
|
ENUM_PROGRAMLISTHEADERITEM_SEND,
|
|
|
|
ENUM_PROGRAMLISTHEADERITEM_END
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PROGITEM_H
|