#ifndef EDITNODEWIDGET_H #define EDITNODEWIDGET_H #include #include class LineEdit; class PushButton; class TextEdit; class QLabel; class QVBoxLayout; class QHBoxLayout; class QGridLayout; class QComboBox; class CheckBox; /** * @brief The EditNodeWidget class * 编辑节点 */ class EditNodeWidget : public QDialog { Q_OBJECT public: EditNodeWidget(QWidget *parent = nullptr); CNodeData node() const; void setNode(CNodeData n); void initWindow(); void initWidgets(); void initLayout(); void connectSignalsAndSlots(); public slots: void slotEditChanged(); void slotCostComboChanged(int); void slotConfirmCLicked(); void slotConcelClicked(); signals: void sigSaveNode(CNodeData n); private: void setUpCostTypes(); private: CNodeData m_node; /// 名称 QLabel *m_nameLabel = nullptr; LineEdit *m_name = nullptr; /// 内涵 QLabel *m_remarkLabel = nullptr; TextEdit *m_remark = nullptr; /// 量纲 QLabel *m_dimenLabel = nullptr; LineEdit *m_dimen = nullptr; /// 成本效益类型 QLabel *m_costLabel = nullptr; QComboBox *m_costComboBox = nullptr; /// 是否生效 QLabel *m_validLabel = nullptr; CheckBox *m_validCheckBox = nullptr; PushButton *m_confirm = nullptr; PushButton *m_cancel = nullptr; QVBoxLayout *m_layout = nullptr; QGridLayout *m_gridLayout = nullptr; QHBoxLayout *m_btnLayout = nullptr; }; #endif // EDITNODEWIDGET_H