Union::Theme Class

class Union::Theme

A collection of StyleRule instances. More...

Header: #include <Theme>
CMake: find_package(Union REQUIRED)
target_link_libraries(mytarget PRIVATE Union::Union)
Inherits: QObject and

Public Types

Ptr

Properties

Public Functions

void insert(Union::StyleRule::Ptr style)
bool load()
Union::ThemeLoader *loader() const
QList<Union::StyleRule::Ptr> matches(const QList<Union::Element::Ptr> &elements)
QString name() const
QString pluginName() const
QList<Union::StyleRule::Ptr> rules()

Static Public Members

Union::Theme::Ptr create(const QString &pluginName, const QString &themeName, std::unique_ptr<Union::ThemeLoader> &&loader)

Detailed Description

Member Type Documentation

[alias] Theme::Ptr

Shorthand for std::shared_ptr<Theme>

Property Documentation

[read-only] name : const QString

The name of the theme.

Access functions:

QString name() const

[read-only] pluginName : const QString

The name of the plugin used to load rules for this Theme.

Access functions:

QString pluginName() const

Member Function Documentation

[static] Union::Theme::Ptr Theme::create(const QString &pluginName, const QString &themeName, std::unique_ptr<Union::ThemeLoader> &&loader)

Create a new instance of Theme.

pluginName The name of the plugin responsible for creating this theme. themeName The name of this theme. loader An instance of ThemeLoader responsible for loading the actual data of this theme.

void Theme::insert(Union::StyleRule::Ptr style)

Insert a new rule into the theme.

style The new rule to add.

bool Theme::load()

Load the theme.

Returns true on success or false if an error occurred.

Union::ThemeLoader *Theme::loader() const

Returns the ThemeLoader of this theme.

QList<Union::StyleRule::Ptr> Theme::matches(const QList<Union::Element::Ptr> &elements)

Returns the list of StyleRule instances that matches a given list of Element instances.

QList<Union::StyleRule::Ptr> Theme::rules()

Returns the list of all StyleRule instances contained in this theme.