#ifndef CREATEPROJWIDGET_H #define CREATEPROJWIDGET_H #include class ProjectInfo; class LineEdit; class CheckBox; class PushButton; class DateTimeEdit; class TextEdit; class QVBoxLayout; class QHBoxLayout; class QGridLayout; class QLabel; /// 创建工程页面 class CreateProjWidget : public QDialog { Q_OBJECT public: typedef enum { Create, // 创建 Update, // 编辑 Info, // 查看 } Mode; CreateProjWidget(QWidget *parent = nullptr); Mode mode() const; void setMode(Mode mode); void resetInputs(); ProjectInfo *projInfo() const; ProjectInfo editedProjInfo() const; void setProjectInfo(ProjectInfo *info); signals: void signalConfirm(); private: void initWindow(); void initWidgets(); void initLayout(); void connectSignalsAndSlots(); private slots: void slotTextChanged(); void slotCheckBoxChanged(); void slotEditClicked(); void slotConfirmClicked(); void slotCancelClicked(); private: Mode m_mode = Create; ProjectInfo *m_projInfo = nullptr; // 项目概要 QLabel *m_summary = nullptr; // 项目概要 LineEdit *m_task = nullptr; // 任务名称 DateTimeEdit *m_time = nullptr; // 评估时间 LineEdit *m_unit = nullptr; // 评估单位 LineEdit *m_crew = nullptr; // 评估人员 LineEdit *m_rank = nullptr; // 职称 TextEdit *m_purpose = nullptr; // 评估目的 TextEdit *m_note = nullptr; // 备注 QLabel *m_taskLabel = nullptr; QLabel *m_timeLabel = nullptr; QLabel *m_unitLabel = nullptr; QLabel *m_crewLabel = nullptr; QLabel *m_rankLabel = nullptr; QLabel *m_purposeLabel = nullptr; QLabel *m_noteLabel = nullptr; QWidget *m_separator = nullptr; // 分隔线 // 项目信息 QLabel *m_projLabel = nullptr; LineEdit *m_proj = nullptr; QLabel *m_typeLabel = nullptr; CheckBox *m_type1 = nullptr; CheckBox *m_type2 = nullptr; CheckBox *m_type3 = nullptr; // 按钮 PushButton *m_edit = nullptr; PushButton *m_confirm = nullptr; PushButton *m_cancel = nullptr; // 布局 QVBoxLayout *m_layout = nullptr; QGridLayout *m_summaryLayout = nullptr; QGridLayout *m_projLayout = nullptr; QHBoxLayout *m_btnLayout = nullptr; }; #endif // CREATEPROJWIDGET_H