ExpertInfoView.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #ifndef EXPERTINFOVIEW_H
  2. #define EXPERTINFOVIEW_H
  3. #include <QWidget>
  4. class LineEdit;
  5. class PasswordLineEdit;
  6. class PushButton;
  7. class TextEdit;
  8. class QVBoxLayout;
  9. class QHBoxLayout;
  10. class QGridLayout;
  11. class QLabel;
  12. ///
  13. /// \brief The ExpertInfoView class
  14. /// 专家信息页面
  15. class ExpertInfoView : public QWidget
  16. {
  17. Q_OBJECT
  18. enum Mode
  19. {
  20. Add, // 新增
  21. Update, // 编辑
  22. Read, // 查看
  23. };
  24. public:
  25. explicit ExpertInfoView(QWidget *parent = nullptr);
  26. void setMode(Mode mode);
  27. void clearInputs();
  28. private:
  29. void initWindow();
  30. void initialize();
  31. void initLayout();
  32. void connectSignalsAndSlots();
  33. void updateState();
  34. private slots:
  35. void slotConfirm();
  36. void slotCancel();
  37. signals:
  38. private:
  39. Mode m_mode = Add;
  40. QVBoxLayout *m_vBoxLayout = nullptr;
  41. QGridLayout *m_gridLayout = nullptr;
  42. QLabel *m_idLabel = nullptr;
  43. LineEdit *m_idLineEdit = nullptr;
  44. QLabel *m_passwordLabel = nullptr;
  45. PasswordLineEdit *m_passwordLineEdit = nullptr;
  46. QLabel *m_nameLabel = nullptr;
  47. LineEdit *m_nameLineEdit = nullptr;
  48. QLabel *m_companyLabel = nullptr;
  49. LineEdit *m_companyLineEdit = nullptr;
  50. QLabel *m_jobLabel = nullptr;
  51. LineEdit *m_jobLineEdit = nullptr;
  52. QLabel *m_majorLabel = nullptr;
  53. LineEdit *m_majorLineEdit = nullptr;
  54. QLabel *m_contactInfoLabel = nullptr;
  55. LineEdit *m_contactInfoLineEdit = nullptr;
  56. QLabel *m_noteLabel = nullptr;
  57. TextEdit *m_noteTextEdit = nullptr;
  58. QHBoxLayout *m_hBoxLayout = nullptr;
  59. PushButton *m_confirmButton = nullptr;
  60. PushButton *m_cancelButton = nullptr;
  61. };
  62. #endif // EXPERTINFOVIEW_H