qt/LedOK/wProgramManager/wEditProgram/wpagelist.h
2022-01-20 10:08:17 +08:00

63 lines
1.3 KiB
C++

#ifndef WPAGELIST_H
#define WPAGELIST_H
#include <QWidget>
#include <QToolBar>
#include <QListWidget>
#include <QVBoxLayout>
#include <QAction>
#include <QGraphicsScene>
#include <QDate>
#include <QDir>
#include <QFile>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonDocument>
#include "loappconfig.h"
#include <QLabel>
class wPageItem;
class wPageList : public QWidget
{
Q_OBJECT
public:
explicit wPageList(const QString &pRoot, int w, int h, QWidget *parent = nullptr);
virtual void keyReleaseEvent(QKeyEvent *event) override;
public:
int load();
void setRes(int w, int h);
void save();
int pageCount() { return m_wPageList->count(); }
void Init();
void setCurrentPage(int i) { m_wPageList->setCurrentRow(i); }
QString m_strProgramItemPath;
bool IsChanged();
signals:
void sigPageSelected(wPageItem*);
void sigDeletePageItem(wPageItem*);
public slots:
void onRestore(const QJsonDocument &json);
void onAdd();
void onCopy();
void onDelete();
void onGoUp();
void onGoDown();
void onCurrentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
private:
QString genNewPageName();
void flashOrder();
private:
QListWidget *m_wPageList;
QLabel * m_ProgramListLable;
int m_width;
int m_height;
};
#endif // WPAGELIST_H