DieItem.h 1000 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef DIEITEM_H
  2. #define DIEITEM_H
  3. #pragma once
  4. #include <QGraphicsRectItem>
  5. #include <QColor>
  6. #include <QDebug>
  7. #include <QPen>
  8. #include <QMenu>
  9. #include <QGraphicsSceneContextMenuEvent>
  10. #include "CInterface.h"
  11. // 自定义矩形代表晶圆单元格
  12. class DieItem : public QObject, public QGraphicsRectItem {
  13. public:
  14. DieItem(int row, int col, PICK_DIE_STATUS status, qreal size, QGraphicsItem* parent = nullptr);
  15. // 获取单元格的行列号
  16. int getRow() const;
  17. int getCol() const;
  18. void setSelected(bool selected);
  19. void setLeftSelected(bool selected);
  20. void setRightSelected(bool selected);
  21. protected:
  22. // void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
  23. // void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
  24. private:
  25. int row, col;
  26. PICK_DIE_STATUS status;
  27. bool isSelected = false;
  28. // 获取单元格状态颜色
  29. QColor getColorByStatus(PICK_DIE_STATUS status);
  30. };
  31. #endif // DIEITEM_H