qt/LedOK/wProgramManager/progitem.h

63 lines
1.6 KiB
C
Raw Normal View History

2022-09-30 18:08:39 +08:00
#ifndef PROGITEM_H
#define PROGITEM_H
#include <QObject>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QDir>
#include <QDateTime>
#include <QJsonObject>
#include <QJsonDocument>
#include <QPushButton>
#include <base/loqtreewidget.h>
class ProgItem : public QObject, public QTreeWidgetItem{
Q_OBJECT
public:
explicit ProgItem(const QString &pRoot, const QString &name, int w, int h, const QString & remarks, LoQTreeWidget *parent = nullptr,QWidget *pWnd=nullptr);
explicit ProgItem(const QString &pRoot, const QJsonObject &json, LoQTreeWidget *parent = nullptr,QWidget *pWnd=nullptr);
void save();
void del();
QJsonObject jRoot();
void refreshLable();
QString m_name;
int m_width;
int m_height;
QString m_remarks;
qint64 m_fsize;
QDateTime m_last;
QPushButton *m_bnName;
public slots:
void onSetProgram();
void onEditProgram();
void onSendProgram();
void onUsbExportProgram();
void onUsbExportProgramPro(QString strPath,QString strPassword);
private:
void init();
QPushButton *m_bnExport;
QPushButton *m_bnSend;
LoQTreeWidget *m_parent;
QString m_strSavePath;
QString mProgDir;
QString m_orgName;
QWidget *m_pWnd=nullptr;
};
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