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 ProjectStateWidget;
  7. class ProjectListWidget;
  8. class PushButton;
  9. class LineEdit;
  10. class QVBoxLayout;
  11. class QHBoxLayout;
  12. class QLabel;
  13. ///
  14. /// \brief The HomeView class
  15. /// 首页
  16. class HomeView : public QWidget
  17. {
  18. Q_OBJECT
  19. public:
  20. explicit HomeView(QWidget *parent = nullptr);
  21. void showEvent(QShowEvent *event) override;
  22. void hideEvent(QHideEvent *event) override;
  23. private:
  24. void initWidgets();
  25. void initLayout();
  26. void connectSignalsAndSlots();
  27. void loadProjects();
  28. QList<ProjectInfo *> searchResult() const;
  29. private slots:
  30. void slotCreateProjClicked();
  31. void slotSearchTextChanged();
  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