Group.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef GROUP_H
  2. #define GROUP_H
  3. #include <QWidget>
  4. #include <QtWidgets/QComboBox>
  5. #include "CameraMaterialGroupWnd/MaterialWindow/Wafer.h"
  6. #include "CameraMaterialGroupWnd/MaterialWindow/Waffle.h"
  7. #include "CameraMaterialGroupWnd/MaterialWindow/MaterialBox.h"
  8. namespace Ui {
  9. class Group;
  10. }
  11. class Group : public QWidget
  12. {
  13. Q_OBJECT
  14. public:
  15. // 相机ID 实时图片 物料窗口类型 下拉框文本
  16. explicit Group(int Id, const QString& imagePath1, int MaterialWindowType, const QStringList& textList, QWidget* parent);
  17. ~Group();
  18. void initForm();
  19. bool eventFilter(QObject *obj, QEvent *event);
  20. void saveGroupSettings(int Id, const QString& imagePath1, int materialWndType, const QStringList& textList);
  21. void saveBorderSettings(); // 新增:保存边框颜色信息
  22. void loadBorderSettings(); // 新增:加载边框颜色信息
  23. void setDatacomboBox(int index);
  24. signals:
  25. void send_button_Signal();
  26. void send_ComboBox_singal(int groupId,int index);
  27. void groupSelected(Group* group, int index);
  28. public slots:
  29. void onclickbutton();
  30. void on_DatacomboBox_currentIndexChanged(int index);
  31. void onGroupSelected(Group* group, int index);
  32. protected:
  33. void check_selected(int index);
  34. void WaferWidget(); // 圆晶
  35. void WaffleWidget(); // 华夫盒
  36. void MaterialBoxWidget(); // 料盒
  37. private:
  38. Ui::Group *ui;
  39. int currentGroupId;
  40. Wafer *wafer; // 声明Wafer指针
  41. Waffle *waffle; // 声明Waffle指针
  42. MaterialBox *materialbox; // 声明materialbox指针
  43. static Group* currentlySelectedGroup; // 当前选中(红色边框)的实例
  44. static Group* previouslySelectedBlueGroup; // 上一次选中且边框为蓝色的实例
  45. static Group* lastClickedGroup; // 上一次点击的实例
  46. static int lastClickedIndex; // 上一次点击的索引
  47. int groupId; // 新增:记录当前 Group 的 ID
  48. };
  49. #endif // GROUP_H