EditNodeWidget.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef EDITNODEWIDGET_H
  2. #define EDITNODEWIDGET_H
  3. #include <QDialog>
  4. #include <CNode.h>
  5. class LineEdit;
  6. class PushButton;
  7. class TextEdit;
  8. class QLabel;
  9. class QVBoxLayout;
  10. class QHBoxLayout;
  11. class QGridLayout;
  12. class QComboBox;
  13. class CheckBox;
  14. /**
  15. * @brief The EditNodeWidget class
  16. * 编辑节点
  17. */
  18. class EditNodeWidget : public QDialog
  19. {
  20. Q_OBJECT
  21. public:
  22. EditNodeWidget(QWidget *parent = nullptr);
  23. CNodeData node() const;
  24. void setNode(CNodeData n);
  25. void initWindow();
  26. void initWidgets();
  27. void initLayout();
  28. void connectSignalsAndSlots();
  29. public slots:
  30. void slotEditChanged();
  31. void slotCostComboChanged(int);
  32. void slotConfirmCLicked();
  33. void slotConcelClicked();
  34. signals:
  35. void sigSaveNode(CNodeData n);
  36. private:
  37. void setUpCostTypes();
  38. private:
  39. CNodeData m_node;
  40. /// 名称
  41. QLabel *m_nameLabel = nullptr;
  42. LineEdit *m_name = nullptr;
  43. /// 内涵
  44. QLabel *m_remarkLabel = nullptr;
  45. TextEdit *m_remark = nullptr;
  46. /// 量纲
  47. QLabel *m_dimenLabel = nullptr;
  48. LineEdit *m_dimen = nullptr;
  49. /// 成本效益类型
  50. QLabel *m_costLabel = nullptr;
  51. QComboBox *m_costComboBox = nullptr;
  52. /// 是否生效
  53. QLabel *m_validLabel = nullptr;
  54. CheckBox *m_validCheckBox = nullptr;
  55. PushButton *m_confirm = nullptr;
  56. PushButton *m_cancel = nullptr;
  57. QVBoxLayout *m_layout = nullptr;
  58. QGridLayout *m_gridLayout = nullptr;
  59. QHBoxLayout *m_btnLayout = nullptr;
  60. };
  61. #endif // EDITNODEWIDGET_H