From 19a4037a1ac2210997f47e27f5c494559ecdd974 Mon Sep 17 00:00:00 2001 From: luisangelsm Date: Mon, 12 Jan 2026 18:47:41 +0100 Subject: [PATCH] Add an abstract class to be implemented by any class that needs theming --- common/themes/themable.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 common/themes/themable.h diff --git a/common/themes/themable.h b/common/themes/themable.h new file mode 100644 index 00000000..fd5f3912 --- /dev/null +++ b/common/themes/themable.h @@ -0,0 +1,24 @@ +#ifndef THEMABLE_H +#define THEMABLE_H + +#include "theme_manager.h" + +class Themable +{ +protected: + void initTheme(QObject *owner) + { + QObject::connect(&ThemeManager::instance(), + &ThemeManager::themeChanged, + owner, + [this]() { + applyTheme(); + }); + + applyTheme(); + } + + virtual void applyTheme() = 0; +}; + +#endif // THEMABLE_H