mainwindow.h 797 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (C) 2023-2024 Stdware Collections (https://www.github.com/stdware)
  2. // Copyright (C) 2021-2023 wangwenx190 (Yuhang Zhao)
  3. // SPDX-License-Identifier: Apache-2.0
  4. #ifndef MAINWINDOW_H
  5. #define MAINWINDOW_H
  6. #include <QtWidgets/QMainWindow>
  7. namespace QWK {
  8. class WidgetWindowAgent;
  9. class StyleAgent;
  10. }
  11. class MainWindow : public QMainWindow {
  12. Q_OBJECT
  13. public:
  14. explicit MainWindow(QWidget *parent = nullptr);
  15. ~MainWindow() override;
  16. enum Theme {
  17. Dark,
  18. Light,
  19. };
  20. Q_ENUM(Theme)
  21. Q_SIGNALS:
  22. void themeChanged();
  23. protected:
  24. bool event(QEvent *event) override;
  25. private:
  26. void installWindowAgent();
  27. void loadStyleSheet(Theme theme);
  28. Theme currentTheme{};
  29. QWK::WidgetWindowAgent *windowAgent;
  30. };
  31. #endif // MAINWINDOW_H