EditNodeWidget.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. /**
  13. * @brief The EditNodeWidget class
  14. * 编辑节点
  15. */
  16. class EditNodeWidget : public QDialog
  17. {
  18. Q_OBJECT
  19. public:
  20. EditNodeWidget(QWidget *parent = nullptr);
  21. CNodeData node() const;
  22. void setNode(CNodeData n);
  23. void initWindow();
  24. void initWidgets();
  25. void initLayout();
  26. void connectSignalsAndSlots();
  27. public slots:
  28. void slotEditChanged();
  29. void slotConfirmCLicked();
  30. void slotConcelClicked();
  31. signals:
  32. void sigSaveNode(CNodeData n);
  33. private:
  34. CNodeData m_node;
  35. QLabel *m_nameLabel = nullptr;
  36. LineEdit *m_name = nullptr;
  37. QLabel *m_remarkLabel = nullptr;
  38. TextEdit *m_remark = nullptr;
  39. QLabel *m_dimenLabel = nullptr;
  40. LineEdit *m_dimen = nullptr;
  41. PushButton *m_confirm = nullptr;
  42. PushButton *m_cancel = nullptr;
  43. QVBoxLayout *m_layout = nullptr;
  44. QGridLayout *m_gridLayout = nullptr;
  45. QHBoxLayout *m_btnLayout = nullptr;
  46. };
  47. #endif // EDITNODEWIDGET_H