#ifndef THEMEMANAGER_H #define THEMEMANAGER_H #include #include #include "IThemePlugin.h" // ============================================================ // ThemeManager — 主题管理器 // // 管理主题插件的注册、切换和应用。 // 在 AppController 初始化时创建,MainWindow 通过它设置主题。 // ============================================================ class ThemeManager : public QObject { Q_OBJECT public: explicit ThemeManager(QObject *parent = nullptr); void registerTheme(IThemePlugin *theme); void setCurrentTheme(const QString &name); IThemePlugin *currentTheme() const { return m_current; } QStringList themeNames() const; IThemePlugin *theme(const QString &name) const; void applyToApplication(QApplication *app); signals: void themeChanged(const QString &name); private: QHash m_themes; IThemePlugin *m_current = nullptr; }; #endif