#ifndef DIEITEM_H #define DIEITEM_H #pragma once #include #include #include #include #include #include #include "CInterface.h" // 自定义矩形代表晶圆单元格 class DieItem : public QObject, public QGraphicsRectItem { public: DieItem(int row, int col, PICK_DIE_STATUS status, qreal size, QGraphicsItem* parent = nullptr); // 获取单元格的行列号 int getRow() const; int getCol() const; void setSelected(bool selected); void setLeftSelected(bool selected); void setRightSelected(bool selected); protected: // void mousePressEvent(QGraphicsSceneMouseEvent *event) override; // void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override; private: int row, col; PICK_DIE_STATUS status; bool isSelected = false; // 获取单元格状态颜色 QColor getColorByStatus(PICK_DIE_STATUS status); }; #endif // DIEITEM_H