Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

42 строки
940 B

  1. #ifndef HMI_H
  2. #define HMI_H
  3. #include <QGraphicsScene>
  4. #include <QWidget>
  5. #include <project.h>
  6. #include "mygraphicsview.h"
  7. namespace Ui {
  8. class HMI;
  9. }
  10. class HMI : public QWidget
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit HMI(QWidget *parent = nullptr);
  15. ~HMI();
  16. void newPage();
  17. void createComponents();
  18. void clearScene();
  19. void applyProjectToScene(const Project& proj, int pageIndex = 0); // 添加页面索引参数
  20. void extractSceneToProject(Project& proj, int pageIndex = 0); // 添加页面索引参数
  21. int currentPageIndex() const; // 获取当前页面索引
  22. protected:
  23. bool eventFilter(QObject *obj, QEvent *event) override;
  24. private slots:
  25. void onListwidgetCurrenttextchanged(const QString &currentText);
  26. private:
  27. Ui::HMI *ui;
  28. QList<QGraphicsScene*> scenes; // 存储多个场景
  29. QList<MyGraphicsView*> views; // 存储多个视图
  30. QString selectedComponentType;
  31. };
  32. #endif // HMI_H