|
- #ifndef HMI_H
- #define HMI_H
-
- #include <QGraphicsScene>
- #include <QWidget>
- #include <project.h>
- #include "mygraphicsview.h"
-
- namespace Ui {
- class HMI;
- }
-
- class HMI : public QWidget
- {
- Q_OBJECT
-
- public:
- explicit HMI(QWidget *parent = nullptr);
- ~HMI();
- void newPage();
- void createComponents();
-
- void clearScene();
- void applyProjectToScene(const Project& proj, int pageIndex = 0); // 添加页面索引参数
- void extractSceneToProject(Project& proj, int pageIndex = 0); // 添加页面索引参数
- int currentPageIndex() const; // 获取当前页面索引
-
- protected:
- bool eventFilter(QObject *obj, QEvent *event) override;
-
- private slots:
- void onListwidgetCurrenttextchanged(const QString ¤tText);
-
- private:
- Ui::HMI *ui;
- QList<QGraphicsScene*> scenes; // 存储多个场景
- QList<MyGraphicsView*> views; // 存储多个视图
- QString selectedComponentType;
- };
-
- #endif // HMI_H
|