WindowMain.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include "Common.h"
  4. #include "Document.h"
  5. #include "StatusBar.h"
  6. QT_BEGIN_NAMESPACE
  7. namespace Ui { class WindowMain; }
  8. QT_END_NAMESPACE
  9. /// <summary>
  10. /// 主界面框架
  11. /// </summary>
  12. class WindowHome;
  13. class WindowRuntime;
  14. class WindowHdw;
  15. class WindowApp;
  16. class WindowMain : public QMainWindow
  17. {
  18. Q_OBJECT
  19. public:
  20. WindowMain(QWidget *parent = nullptr);
  21. ~WindowMain();
  22. private:
  23. Ui::WindowMain*ui;
  24. protected:
  25. // 创建菜单Action
  26. void createMainActions();
  27. // 创建状态栏
  28. void createStatusbar();
  29. // 创建界面布局
  30. void createLayouts();
  31. // 槽函数
  32. public slots :
  33. // 点击按钮切换窗体
  34. void onViewRunTime();
  35. void onViewApp();
  36. // 菜单响应函数
  37. // File
  38. void onFileNew();
  39. void onFileOpen();
  40. void onFileSave();
  41. void onFileSaveAs();
  42. // Run
  43. void onTaskRun();
  44. void onTaskRunonce();
  45. void onTaskStop();
  46. // 系统
  47. void onPreferences();
  48. void onAppInfo();
  49. private:
  50. // Help
  51. QAction* helpAboutAction;
  52. // 状态栏
  53. QStatusBar* mainStatusBar;
  54. StatusBar* statusLabel;
  55. // 顶部的分组控件及其布局
  56. QGroupBox* groupTop;
  57. QHBoxLayout* groupLayout;
  58. // 中部界面容器以及布局
  59. // 垂直布局
  60. QVBoxLayout* layoutSubMain;
  61. // 其他子界面
  62. WindowRuntime* runtimeWindow;
  63. WindowApp* appWindow;
  64. // 多个窗体的Stack
  65. QStackedWidget* stackWindows;
  66. // 存档文件类
  67. Document m_Doc;
  68. };
  69. #endif // MAINWINDOW_H