Add an abstract class to be implemented by any class that needs theming

This commit is contained in:
luisangelsm
2026-01-12 18:47:41 +01:00
parent cc753e1866
commit 19a4037a1a

24
common/themes/themable.h Normal file
View File

@ -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