12345678910111213141516171819202122232425262728293031323334353637383940 |
- #ifndef MATERIALBOX_H
- #define MATERIALBOX_H
- #include <QApplication>
- #include <QWidget>
- #include <QPainter>
- #include <QMouseEvent>
- #include <vector>
- #include <QString>
- #include <QDebug>
- #include "CInterface.h"
- #include "MaterialBoxGraphicsView.h"
- #include <QFrame>
- // 枚举定义:料盒的状态
- enum BoxStatus {
- Idle, // 空闲
- Occupied, // 已占用
- };
- // 自定义绘制窗口类
- class MaterialBox : public QWidget {
- public:
- MaterialBox(int flag, QWidget *parent = nullptr);
- void paintInitFrom(QWidget *parent);
- QPixmap getGlobalPixmap() const;
- void initFrom(QWidget *parent);
- MaterialBoxGraphicsView* view;
- QGraphicsScene* scene;
- private slots:
- void handleLayerRightClicked(int layer);
- protected:
- void paintEvent(QPaintEvent *event) override;
- private:
- MATERIAL_BOX_STRUCT boxes; // 所有料盒的数据
- QPixmap globalPixmap;
- };
- #endif // MATERIALBOX_H
|