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.

39 lines
746 B

  1. #ifndef PLC_H
  2. #define PLC_H
  3. #include <QGraphicsScene>
  4. #include <QWidget>
  5. #include "project.h"
  6. namespace Ui {
  7. class PLC;
  8. }
  9. class PLC : public QWidget
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit PLC(QWidget *parent = nullptr);
  14. ~PLC();
  15. void createComponents();
  16. void clearScene();
  17. void applyProjectToScene(const Project& proj); // 加载工程到scene
  18. void extractSceneToProject(Project& proj); // 从scene导出工程数据
  19. protected:
  20. bool eventFilter(QObject *obj, QEvent *event) override;
  21. private slots:
  22. void onListwidgetCurrenttextchanged(const QString &currentText);
  23. void btnInsertClicked();
  24. private:
  25. Ui::PLC *ui;
  26. QGraphicsScene *plc_scene_;
  27. QString selectedComponentType;
  28. };
  29. #endif // PLC_H