From 3871bfc5d3aff45e498fa2944c27e6eb5d146c8e Mon Sep 17 00:00:00 2001 From: SineStriker <trueful@163.com> Date: 周三, 20 12月 2023 19:56:32 +0800 Subject: [PATCH] Add mac hot-switch implementations --- examples/mainwindow/mainwindow.h | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/examples/mainwindow/mainwindow.h b/examples/mainwindow/mainwindow.h index 46f23d3..5511105 100644 --- a/examples/mainwindow/mainwindow.h +++ b/examples/mainwindow/mainwindow.h @@ -4,12 +4,28 @@ #include <QtWidgets/QMainWindow> class MainWindow : public QMainWindow { + Q_OBJECT public: explicit MainWindow(QWidget *parent = nullptr); - ~MainWindow(); + ~MainWindow() override; + + enum Theme { + Dark, + Light, + }; + Q_ENUM(Theme) + +Q_SIGNALS: + void themeChanged(); protected: + bool event(QEvent *event) override; + +private: void installWindowAgent(); + void loadStyleSheet(Theme theme); + + Theme currentTheme{}; }; #endif // MAINWINDOW_H -- Gitblit v1.9.1