Group.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 recordBorderInfo(int groupId, const QString& side);
  24. QString getBlueBorderStyle();
  25. void setDatacomboBox(int index);
  26. signals:
  27. void send_button_Signal();
  28. void send_ComboBox_singal(int groupId,int index);
  29. void groupSelected(Group* group, int index);
  30. public slots:
  31. void onclickbutton();
  32. void on_DatacomboBox_currentIndexChanged(int index);
  33. void onGroupSelected(Group* group, int index);
  34. protected:
  35. void showEvent(QShowEvent *event) override;
  36. void hideEvent(QHideEvent *event) override;
  37. void check_selected(int index);
  38. void WaferWidget(); // 圆晶
  39. void WaffleWidget(); // 华夫盒
  40. void MaterialBoxWidget(); // 料盒
  41. private:
  42. Ui::Group *ui;
  43. int currentGroupId;
  44. Wafer *wafer; // 声明Wafer指针
  45. Waffle *waffle; // 声明Waffle指针
  46. MaterialBox *materialbox; // 声明materialbox指针
  47. static Group* currentlySelectedGroup; // 当前选中(红色边框)的实例
  48. static Group* previouslySelectedBlueGroup; // 上一次选中且边框为蓝色的实例
  49. static Group* lastClickedGroup; // 上一次点击的实例
  50. static int lastClickedIndex; // 上一次点击的索引
  51. static int lastSavedIndex; // 上次保存的索引
  52. int groupId; // 新增:记录当前 Group 的 ID
  53. };
  54. #endif // GROUP_H