Union::ThemeRegistry Class
class Union::ThemeRegistryA class to load and keep track of Theme instances. More...
Header: | #include <ThemeRegistry> |
CMake: | find_package(Union REQUIRED) target_link_libraries(mytarget PRIVATE Union::Union) |
Inherits: | QObject |
Public Functions
std::shared_ptr<Union::Theme> | defaultTheme() |
void | load() |
void | save() |
std::shared_ptr<Union::Theme> | theme(const QString &themeName, const QString &pluginName = QString{}) |
Static Public Members
std::shared_ptr<Union::ThemeRegistry> | instance() |
Detailed Description
This can be considered to be the main entry point to Union. It loads input plugins and uses those to create new Theme instances. It also handles caching of the Theme instances.
Member Function Documentation
std::shared_ptr<Union::Theme> ThemeRegistry::defaultTheme()
Get the default Theme instance as determined by the current platform.
Returns a Theme instance for the current default theme.
[static]
std::shared_ptr<Union::ThemeRegistry> ThemeRegistry::instance()
Returns the global instance of ThemeRegistry.
void ThemeRegistry::load()
Load any cached data from disk.
void ThemeRegistry::save()
Save data to disk for caching.
std::shared_ptr<Union::Theme> ThemeRegistry::theme(const QString &themeName, const QString &pluginName = QString{})
Get a theme instance by name.
themeName The name of the theme to retrieve. pluginName The name of the input plugin that provides the theme. If empty, the theme will be searched for in available plugins.
Returns a Theme instance that matches `themeName` and `pluginName`, or `nullptr` if it could not be found.