123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #ifndef CREATEPROJWIDGET_H
- #define CREATEPROJWIDGET_H
- #include <QDialog>
- 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
|