12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- #ifndef EXPERTINFOWIDGET_H
- #define EXPERTINFOWIDGET_H
- #include <QDialog>
- class LineEdit;
- class PasswordLineEdit;
- class PushButton;
- class TextEdit;
- class DateTimeEdit;
- class QVBoxLayout;
- class QHBoxLayout;
- class QGridLayout;
- class QLabel;
- ///
- /// 专家信息页面
- class ExpertInfoWidget : public QWidget
- {
- Q_OBJECT
- public:
- typedef enum
- {
- Add, // 新增
- Update, // 编辑
- Read, // 查看
- } Mode;
- Q_ENUM(Mode)
- explicit ExpertInfoWidget(QWidget *parent = nullptr);
- void showEvent(QShowEvent *event) override;
- void hideEvent(QHideEvent *event) override;
- void setMode(Mode mode);
- void clearInputs();
- private:
- void initWindow();
- void initialize();
- void initLayout();
- void connectSignalsAndSlots();
- void updateState();
- void setDetailsHideen(bool hidden);
- void setEditable(bool editable);
- private slots:
- void slotConfirm();
- void slotCancel();
- signals:
- private:
- Mode m_mode = Add;
- QVBoxLayout *m_vBoxLayout = nullptr;
- QGridLayout *m_gridLayout = nullptr;
- QLabel *m_idLabel = nullptr;
- LineEdit *m_idLineEdit = nullptr;
- QLabel *m_passwordLabel = nullptr;
- PasswordLineEdit *m_passwordLineEdit = nullptr;
- QLabel *m_nameLabel = nullptr;
- LineEdit *m_nameLineEdit = nullptr;
- QLabel *m_companyLabel = nullptr;
- LineEdit *m_companyLineEdit = nullptr;
- QLabel *m_jobLabel = nullptr;
- LineEdit *m_jobLineEdit = nullptr;
- QLabel *m_majorLabel = nullptr;
- LineEdit *m_majorLineEdit = nullptr;
- QLabel *m_contactInfoLabel = nullptr;
- LineEdit *m_contactInfoLineEdit = nullptr;
- QLabel *m_timeLabel = nullptr;
- DateTimeEdit *m_timeLineEdit = nullptr;
- QLabel *m_noteLabel = nullptr;
- TextEdit *m_noteTextEdit = nullptr;
- QHBoxLayout *m_hBoxLayout = nullptr;
- PushButton *m_confirmButton = nullptr;
- PushButton *m_cancelButton = nullptr;
- };
- #endif // EXPERTINFOWIDGET_H
|