ProjectView.h 998 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef PROJECTVIEW_H
  2. #define PROJECTVIEW_H
  3. #include <QWidget>
  4. class ProjectInfo;
  5. class PushButton;
  6. class TreeWidget;
  7. class QVBoxLayout;
  8. class QHBoxLayout;
  9. class QLabel;
  10. /// 工程视图
  11. class ProjectView : public QWidget
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit ProjectView(ProjectInfo *proj = nullptr, QWidget *parent = nullptr);
  16. void showEvent(QShowEvent *event) override;
  17. void hideEvent(QHideEvent *event) override;
  18. ProjectInfo *proj() const;
  19. signals:
  20. void sigClose();
  21. private:
  22. void initWidgets();
  23. void initLayout();
  24. void connectSigalsAndSlots();
  25. private:
  26. ProjectInfo *m_proj = nullptr;
  27. bool m_initilized = false;
  28. QVBoxLayout *m_layout = nullptr;
  29. QHBoxLayout *m_headerLayout = nullptr;
  30. QHBoxLayout *m_contentLayout = nullptr;
  31. QLabel *m_title = nullptr;
  32. PushButton *m_close = nullptr;
  33. TreeWidget *m_tree = nullptr;
  34. QWidget *m_contentSeperator = nullptr;
  35. };
  36. #endif // PROJECTVIEW_H