qt/LedOK/progpanel.h

72 lines
1.9 KiB
C
Raw Normal View History

2022-08-25 18:37:24 +08:00
#ifndef PROGPANEL_H
#define PROGPANEL_H
2022-01-04 18:11:48 +08:00
#include <QWidget>
#include <QStyleOption>
#include <QPainter>
#include <QFile>
#include <QAction>
#include <QTreeWidgetItem>
#include <QCheckBox>
#include <QPushButton>
#include <QDebug>
#include <QLabel>
#include <QDateTime>
#include <QList>
#include <QDir>
#include <QFile>
#include <QStandardPaths>
#include <QStringList>
#include <QJsonValue>
#include <QJsonObject>
#include <QJsonDocument>
2022-08-25 18:37:24 +08:00
#include "cfg.h"
#include <base/loqtreewidget.h>
2022-01-04 18:11:48 +08:00
#include <wProgramManager/wnewprogram.h>
2022-08-25 18:37:24 +08:00
#include <wProgramManager/progeditorwin.h>
2022-01-04 18:11:48 +08:00
#include "wProgramManager/wprogramitem.h"
2022-08-25 18:37:24 +08:00
class ProgPanel : public QWidget {
2022-01-04 18:11:48 +08:00
Q_OBJECT
public:
2022-08-25 18:37:24 +08:00
explicit ProgPanel(QWidget *parent = nullptr);
~ProgPanel();
2022-01-04 18:11:48 +08:00
2022-08-25 18:37:24 +08:00
QTreeWidgetItem *m_headerItem = nullptr;
2022-01-04 18:11:48 +08:00
protected:
2022-08-25 18:37:24 +08:00
void changeEvent(QEvent *) override;
void transUi();
2022-01-04 18:11:48 +08:00
bool checkIfNameRepeated(const QString &name, QTreeWidgetItem *skip = nullptr);
2022-08-25 18:37:24 +08:00
public slots:
2022-01-04 18:11:48 +08:00
void onNewClicked(bool f);
void onEditClicked(bool f);
void onDeleteClicked(bool f);
void onImportClicked(bool f);
void onExportClicked(bool f);
void onRestoreProgram(const QJsonDocument &pro);
void onCreateNewProgram(QString name, QSize res, QString remarks);
void onCreateNewProgramOnOpenEditProgramWidget(QString name, QSize res, QString remarks);
void onImportProgram(QString strImportDir,QString strTip1);
void onExportProgram(QString strImportDir,QString strTip1);
void FilterProgram(const QString &strtemp);
private slots:
void OnClickColumn(int iColumn);
private:
2022-08-25 18:37:24 +08:00
QString progDir;
2022-01-04 18:11:48 +08:00
QList<wProgramItem *> m_pwPorgramItemList;
void readSettings();
void writeSettings();
2022-08-25 18:37:24 +08:00
LoQTreeWidget *wProgramList = nullptr;
QPushButton *bnNew = nullptr;
QPushButton *bnEdit = nullptr;
QPushButton *bnDelete = nullptr;
QPushButton *bnImport, *bnExport;
QPushButton *bnSend, *btnPlay;
2022-01-04 18:11:48 +08:00
};
2022-08-25 18:37:24 +08:00
#endif // PROGPANEL_H