HomeView.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef HOMEVIEW_H
  2. #define HOMEVIEW_H
  3. #include <QWidget>
  4. class ProjectInfo;
  5. class CreateProjWidget;
  6. class ProjectListWidget;
  7. class PushButton;
  8. class LineEdit;
  9. class QVBoxLayout;
  10. class QHBoxLayout;
  11. class QLabel;
  12. ///
  13. /// \brief The HomeView class
  14. /// 首页
  15. class HomeView : public QWidget
  16. {
  17. Q_OBJECT
  18. public:
  19. explicit HomeView(QWidget *parent = nullptr);
  20. void showEvent(QShowEvent *event) override;
  21. void hideEvent(QHideEvent *event) override;
  22. private:
  23. void initWidgets();
  24. void initLayout();
  25. void connectSignalsAndSlots();
  26. void loadProjects();
  27. QList<ProjectInfo *> searchResult() const;
  28. private slots:
  29. void slotCreateProjClicked();
  30. void slotSearchTextChanged();
  31. void slotConfirmCreate();
  32. private:
  33. bool m_initilized = false;
  34. QVBoxLayout *m_layout = nullptr;
  35. QHBoxLayout *m_topLayout = nullptr;
  36. QLabel *m_title = nullptr;
  37. PushButton *m_create = nullptr;
  38. LineEdit *m_search = nullptr;
  39. PushButton *m_filter = nullptr;
  40. ProjectListWidget *m_projListWidget = nullptr;
  41. CreateProjWidget *m_createProjWidget = nullptr;
  42. QList<ProjectInfo *> m_projList;
  43. };
  44. #endif // HOMEVIEW_H