SchemeFlowWidget.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef SCHEMEFLOWWIDGET_H
  2. #define SCHEMEFLOWWIDGET_H
  3. #include <QWidget>
  4. #include "SchemePlanManager.h"
  5. #include <shemeFlow/DataFlowModel.h>
  6. #include <shemeFlow/FlowGraphModel.h>
  7. #include <shemeFlow/DataFlowModel.h>
  8. #include <shemeFlow/FlowTemplateDataModel.h>
  9. #include <QtNodes/BasicGraphicsScene>
  10. #include <QtNodes/ConnectionStyle>
  11. #include <QtNodes/DataFlowGraphicsScene>
  12. // #include <QtNodes/GraphicsView>
  13. #include <QtNodes/GraphicsViewStyle>
  14. #include <QtNodes/NodeDelegateModelRegistry>
  15. using QtNodes::BasicGraphicsScene;
  16. using QtNodes::ConnectionStyle;
  17. using QtNodes::DataFlowGraphicsScene;
  18. // using QtNodes::GraphicsView;
  19. using QtNodes::GraphicsViewStyle;
  20. using QtNodes::NodeDelegateModelRegistry;
  21. using QtNodes::NodeRole;
  22. using QtNodes::NodeStyle;
  23. // class GraphicsView;
  24. class ProjectInfo;
  25. class QHBoxLayout;
  26. /**
  27. * @brief The SchemeFlowWidget class
  28. * 方案流程图
  29. */
  30. class SchemeFlowWidget : public QWidget
  31. {
  32. Q_OBJECT
  33. public:
  34. explicit SchemeFlowWidget(QWidget *parent = nullptr);
  35. ~SchemeFlowWidget();
  36. /// 当前页面的评估方案
  37. QList<SchemePlanManager::SchemeProcessInfo> schemes() const;
  38. void loadSchemes(const QList<SchemePlanManager::SchemeProcessInfo> &schems);
  39. void setAllowEdit(bool allow);
  40. signals:
  41. void sigSchemeProcessEdited(const SchemePlanManager::SchemeProcessInfo &process);
  42. private:
  43. void initWidget();
  44. void clearAllNodes();
  45. private slots:
  46. void slotSchemeProcessEdited(const SchemePlanManager::SchemeProcessInfo &process);
  47. private:
  48. DataFlowModel *m_graphModel = nullptr;
  49. QHBoxLayout *m_layout = nullptr;
  50. bool m_allowEdit = true;
  51. };
  52. #endif // SCHEMEFLOWWIDGET_H