You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #ifndef MAINWINDOW_H
- #define MAINWINDOW_H
-
- #include <QMainWindow>
- #include <QTabWidget>
- #include <QToolBar>
- #include "document.h"
-
- QT_BEGIN_NAMESPACE
- namespace Ui { class MainWindow; }
- QT_END_NAMESPACE
-
- class MainWindow : public QMainWindow
- {
- Q_OBJECT
-
- public:
- MainWindow(QWidget *parent = nullptr);
- ~MainWindow();
-
- protected:
- bool eventFilter(QObject *obj, QEvent *event) override;
-
- private slots:
- void onNewHMI(); // 新建HMI文档
- void onNewPLC(); // 新建PLC文档
- void onTabChanged(int idx); // 标签页切换时更新工具栏
-
- private:
- void createMenus(); // 创建菜单栏
- void createToolbars(); // 创建工具栏(左侧)
- void updateToolBar(BaseDocument *doc); // 根据文档类型更新工具栏
-
- QTabWidget *m_tabWidget; // 多文档标签页
- QToolBar *m_leftToolBar; // 左侧工具栏
- int m_hmiCount = 0; // HMI文档计数器
- int m_plcCount = 0; // PLC文档计数器
- };
-
- #endif // MAINWINDOW_H
|