MainWnd.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #pragma once
  2. #ifndef MAINWND_H
  3. #define MAINWND_H
  4. #include <QMainWindow>
  5. #include <QToolButton>
  6. #include <QJsonObject>
  7. #include <QtSql>
  8. #include <QSqlDatabase>
  9. #include <QSqlQuery>
  10. #include <QSqlError>
  11. #include <QPointer>
  12. #include "gen_interface.h"
  13. #include "Src/Sql/SqlOperation.h"
  14. #include "Src/CameraBind.h"
  15. //struct ST_RUN_MSG
  16. //{
  17. // int nCameraID; //相机ID
  18. // int nErrType; // 错误类型 ,0 没错误,依次1,2,3
  19. // int nErrorLevel; //错误等级 0,1,2,3
  20. // std::string stErrInfo; // 错误信息
  21. // std::string stModule; // 模块
  22. // std::string stAxis; // 轴
  23. // int nCallMethod; //调用方式(手动点击按钮,自动运行,单轴运行)
  24. //};
  25. QT_BEGIN_NAMESPACE
  26. namespace Ui {
  27. class MainWnd;
  28. }
  29. QT_END_NAMESPACE
  30. class OriginalWnd;
  31. class MainWnd : public QMainWindow
  32. {
  33. Q_OBJECT
  34. public:
  35. MainWnd(QWidget* parent = nullptr);
  36. ~MainWnd();
  37. private:
  38. void Init();
  39. void setChineseMode(QMainWindow* MainWnd);
  40. void InitForm();
  41. /**加载登录界面
  42. */
  43. void LoadLoginPage();
  44. protected:
  45. void applyTheme(int themeValue);
  46. bool eventFilter(QObject* obj, QEvent* event);
  47. int m_aaaaaa = 0;
  48. /**切换侧边栏
  49. */
  50. void SwitchToConfig(void (OriginalWnd::* switchMethod)());
  51. signals:
  52. void setLanguageSignal(const int& data);
  53. void styleChanged();
  54. private slots:
  55. void onCurrentWidgetChanged();
  56. void on_tabHomeBtn_clicked();
  57. void on_pushButton_clicked();
  58. void on_tabProductionBtn_clicked();
  59. void on_tabProgramBtn_clicked();
  60. void on_tabModuleBtn_clicked();
  61. void on_tabDispositionBtn_clicked();
  62. void on_tabDiagnosisBtn_clicked();
  63. void on_tabSystemBtn_clicked();
  64. // //从数据库中获取systemconfig表中的信息
  65. // QJsonObject getInfofromDb();
  66. // int getLanguageValue();
  67. // int getThemeValue();
  68. // void setLanguageValue(int data);
  69. // void setThemeValue(int data);
  70. private slots:
  71. void ShowOriginalWndSlots();
  72. void CloseMainWndSlots();
  73. private:
  74. Ui::MainWnd* ui;
  75. Gen_Interface gen_if;
  76. /**相机绑定接口
  77. */
  78. QPointer<CameraBind> m_pCameraBind;
  79. /**原始窗口?
  80. */
  81. QPointer<OriginalWnd> m_pOriginalWnd;
  82. bool initialIconSet;
  83. /**所有sql 数据加载
  84. */
  85. SqlOperation* m_sqlOper;
  86. };
  87. #endif // MAINWND_H