Union::Style Class
class Union::StyleA collection of StyleRule instances. More...
| Header: | #include <Style> |
| CMake: | find_package(Union REQUIRED)target_link_libraries(mytarget PRIVATE Union::Union) |
| Inherits: | QObject and |
Public Types
Properties
- name : const QString
- pluginName : const QString
Public Functions
| void | insert(Union::StyleRule::Ptr style) |
| bool | load() |
| Union::StyleLoader * | 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::Style::Ptr | create(const QString &pluginName, const QString &styleName, std::unique_ptr<Union::StyleLoader> &&loader) |
Detailed Description
Member Type Documentation
[alias] Style::Ptr
Shorthand for std::shared_ptr<Style>
Property Documentation
[read-only] name : const QString
The name of the style.
Access functions:
| QString | name() const |
[read-only] pluginName : const QString
The name of the plugin used to load rules for this Style.
Access functions:
| QString | pluginName() const |
Member Function Documentation
[static] Union::Style::Ptr Style::create(const QString &pluginName, const QString &styleName, std::unique_ptr<Union::StyleLoader> &&loader)
Create a new instance of Style.
pluginName The name of the plugin responsible for creating this style. styleName The name of this style. loader An instance of StyleLoader responsible for loading the actual data of this style.
void Style::insert(Union::StyleRule::Ptr style)
Insert a new rule into the style.
style The new rule to add.
bool Style::load()
Load the style.
Returns true on success or false if an error occurred.
Union::StyleLoader *Style::loader() const
Returns the StyleLoader of this style.
QList<Union::StyleRule::Ptr> Style::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> Style::rules()
Returns the list of all StyleRule instances contained in this style.