ExpertInfoWidget.h 1.7 KB

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