ExpertInfoView.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. signals:
  35. private:
  36. Mode m_mode = Add;
  37. QVBoxLayout *m_vBoxLayout = nullptr;
  38. QGridLayout *m_gridLayout = nullptr;
  39. QLabel *m_idLabel = nullptr;
  40. LineEdit *m_idLineEdit = nullptr;
  41. QLabel *m_passwordLabel = nullptr;
  42. PasswordLineEdit *m_passwordLineEdit = nullptr;
  43. QLabel *m_nameLabel = nullptr;
  44. LineEdit *m_nameLineEdit = nullptr;
  45. QLabel *m_companyLabel = nullptr;
  46. LineEdit *m_companyLineEdit = nullptr;
  47. QLabel *m_jobLabel = nullptr;
  48. LineEdit *m_jobLineEdit = nullptr;
  49. QLabel *m_majorLabel = nullptr;
  50. LineEdit *m_majorLineEdit = nullptr;
  51. QLabel *m_contactInfoLabel = nullptr;
  52. LineEdit *m_contactInfoLineEdit = nullptr;
  53. QLabel *m_noteLabel = nullptr;
  54. TextEdit *m_noteTextEdit = nullptr;
  55. QHBoxLayout *m_hBoxLayout = nullptr;
  56. PushButton *m_confirmButton = nullptr;
  57. PushButton *m_cancelButton = nullptr;
  58. };
  59. #endif // EXPERTINFOVIEW_H