MainWindow.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QFrame>
  4. #include <QMainWindow>
  5. class PopUpAniStackedWidget;
  6. class QHBoxLayout;
  7. class NavigationInterface;
  8. class StandardTitleBar;
  9. class StackedWidget : public QFrame {
  10. Q_OBJECT
  11. public:
  12. StackedWidget(QWidget *parent = nullptr);
  13. void addWidget(QWidget *widget);
  14. void setCurrentWidget(QWidget *widget, bool popOut = false);
  15. void setCurrentIndex(int index, bool popOut = false);
  16. PopUpAniStackedWidget *view() const;
  17. signals:
  18. void currentWidgetChanged(QWidget *);
  19. private:
  20. QHBoxLayout *m_hBoxLayout;
  21. PopUpAniStackedWidget *m_view;
  22. };
  23. class MainWindow : public QMainWindow {
  24. Q_OBJECT
  25. public:
  26. MainWindow(QWidget *parent = nullptr);
  27. ~MainWindow();
  28. private:
  29. void initWindow();
  30. void initLayout();
  31. void resizeEvent(QResizeEvent *event) override;
  32. private:
  33. StandardTitleBar *m_titleBar;
  34. QHBoxLayout *m_hBoxLayout;
  35. QHBoxLayout *m_widgetLayout;
  36. StackedWidget *m_stackWidget;
  37. NavigationInterface *m_navigationInterface;
  38. };
  39. #endif // MAINWINDOW_H