#ifndef WPROGRAMITEM_H #define WPROGRAMITEM_H #include #include #include #include #include #include #include #include #include #include class wProgramItem : public QObject, public QTreeWidgetItem { Q_OBJECT Q_PROPERTY(QString name MEMBER m_name READ name WRITE setName NOTIFY nameChanged ) Q_PROPERTY(int width MEMBER m_width READ width WRITE setWidth NOTIFY widthChanged ) Q_PROPERTY(int height MEMBER m_height READ height WRITE setHeight NOTIFY heightChanged ) Q_PROPERTY(QString remarks MEMBER m_remarks READ remarks WRITE setRemarks NOTIFY remarksChanged) Q_PROPERTY(int fsize MEMBER m_fsize READ fsize WRITE setFsize NOTIFY fsizeChanged ) Q_PROPERTY(QDateTime last MEMBER m_last READ last WRITE setLast NOTIFY lastChanged ) public: explicit wProgramItem(const QString &pRoot, const QString &name, int w, int h, const QString & remarks, LoQTreeWidget *parent = nullptr,QWidget *pWnd=nullptr); explicit wProgramItem(const QString &pRoot, const QJsonObject &json, LoQTreeWidget *parent = nullptr,QWidget *pWnd=nullptr); // virtual ~wProgramItem() override {} private: void init(); QPushButton *m_bnExport; QPushButton *m_bnSend; public: void save(); void del(); QJsonObject jRoot(); void refreshLable(); public: QString name() const { return m_name; } int width() const { return m_width; } int height() const { return m_height; } QString remarks() const { return m_remarks; } qint64 fsize() const { return m_fsize; } QDateTime last() const { return m_last; } public: void setName(const QString &s) { m_name = s; } void setWidth(int w) { m_width = w; } void setHeight(int h) { m_height = h; } void setRemarks(const QString &s) { m_remarks = s; } void setFsize(qint64 n) { m_fsize = n; } void setLast(const QDateTime &s) { m_last = s; } QString GetBnName(); signals: void nameChanged(const QString &); void widthChanged(int); void heightChanged(int); void remarksChanged(const QString &); void fsizeChanged(quint64); void lastChanged(const QDateTime &); void sigEditProgram(); public slots: void onAttrChanged(); void onAttrChanged(const QString &name, int w, int h, const QString &remarks); protected slots: void onSetProgram(); void onEditProgram(); void onSendProgram(); void onUsbExportProgram(); void onUsbExportProgramPro(QString strPath,QString strPassword); private: QString m_name; int m_width; int m_height; QString m_remarks; qint64 m_fsize; QDateTime m_last; QString m_strConverSaveTmpPath=""; void DeleteOtherFilesInDir(); private: LoQTreeWidget *m_parent; QPushButton *m_bnName; QString m_strSavePath; QString m_strProgramItemPath; 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 // WPROGRAMITEM_H