#ifndef HMI_H #define HMI_H #include #include #include #include "mygraphicsview.h" #include "registermanager.h" namespace Ui { class HMI; } class HMI : public QWidget { Q_OBJECT public: explicit HMI(RegisterManager* regManager, 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 scenes; // 存储多个场景 QList views; // 存储多个视图 QString selectedComponentType; }; #endif // HMI_H