qt/LedOK/program/etable.h

45 lines
1.1 KiB
C
Raw Permalink Normal View History

2025-05-23 18:35:00 +08:00
#ifndef ETABLE_H
#define ETABLE_H
#include "ebase.h"
2025-06-27 22:06:33 +08:00
#include "gutil/qgui.h"
2025-12-30 17:22:43 +08:00
#include "base/locolorselector.h"
#include "xlsxworksheet.h"
2025-05-23 18:35:00 +08:00
2025-12-30 17:22:43 +08:00
class PaintTableWidget : public TableWidget {
2025-05-23 18:35:00 +08:00
Q_OBJECT
public:
2025-12-30 17:22:43 +08:00
using TableWidget::TableWidget;
EBase *ebase = 0;
protected:
void paintEvent(QPaintEvent *) override;
};
2025-05-23 18:35:00 +08:00
2025-12-30 17:22:43 +08:00
class ETable : public EBase {
Q_OBJECT
public:
explicit ETable(int, int, EBase *multiWin = 0);
explicit ETable(const JObj &json, const QString &dir, EBase *multiWin = 0);
void init(int=0, int=0);
int read(QXlsx::Worksheet *);
void grabImg();
2025-05-23 18:35:00 +08:00
int type() const override {return EBase::Table;}
2025-12-30 17:22:43 +08:00
JObj attrJson() override;
bool save(const QString &) override;
2025-05-23 18:35:00 +08:00
void paint(QPainter*, const QStyleOptionGraphicsItem *, QWidget *) override;
2025-06-27 22:06:33 +08:00
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
2025-05-23 18:35:00 +08:00
QWidget* attrWgt() override;
2025-12-30 17:22:43 +08:00
EmitCloseWidget dlg;
PaintTableWidget *table = 0;
2025-06-27 22:06:33 +08:00
QPixmap img;
2025-12-30 17:22:43 +08:00
QByteArray png;
LoColorSelector *edGridColor;
QString name;
QString direction;
int speed = 60;
bool isAutoSetting = false;
2025-05-23 18:35:00 +08:00
};
#endif // ETABLE_H