Union::Properties::StyleProperty Class

class Union::Properties::StyleProperty

The root property group for all elements. More...

Header: #include <StyleProperty>
CMake: find_package(Union REQUIRED)
target_link_libraries(mytarget PRIVATE Union::Union)

Public Functions

StyleProperty()
StyleProperty(const Union::Properties::StyleProperty &other)
StyleProperty(Union::Properties::StyleProperty &&other)
std::optional<Union::Properties::BackgroundProperty> background() const
Union::Properties::BackgroundProperty background_or_new() const
std::optional<Union::Properties::BorderProperty> border() const
Union::Properties::BorderProperty border_or_new() const
std::optional<Union::Properties::CornersProperty> corners() const
Union::Properties::CornersProperty corners_or_new() const
bool hasAnyValue() const
std::optional<Union::Properties::IconProperty> icon() const
Union::Properties::IconProperty icon_or_new() const
std::optional<Union::Properties::LayoutProperty> layout() const
Union::Properties::LayoutProperty layout_or_new() const
std::optional<Union::Properties::OutlineProperty> outline() const
Union::Properties::OutlineProperty outline_or_new() const
void setBackground(const std::optional<Union::Properties::BackgroundProperty> &newValue)
void setBorder(const std::optional<Union::Properties::BorderProperty> &newValue)
void setCorners(const std::optional<Union::Properties::CornersProperty> &newValue)
void setIcon(const std::optional<Union::Properties::IconProperty> &newValue)
void setLayout(const std::optional<Union::Properties::LayoutProperty> &newValue)
void setOutline(const std::optional<Union::Properties::OutlineProperty> &newValue)
void setShadow(const std::optional<Union::Properties::ShadowProperty> &newValue)
void setText(const std::optional<Union::Properties::TextProperty> &newValue)
std::optional<Union::Properties::ShadowProperty> shadow() const
Union::Properties::ShadowProperty shadow_or_new() const
std::optional<Union::Properties::TextProperty> text() const
Union::Properties::TextProperty text_or_new() const
Union::Properties::StyleProperty &operator=(Union::Properties::StyleProperty &&other)
Union::Properties::StyleProperty &operator=(const Union::Properties::StyleProperty &other)

Static Public Members

Union::Properties::StyleProperty empty()
void resolveProperties(const Union::Properties::StyleProperty &source, Union::Properties::StyleProperty &destination)
QDebug operator<<(QDebug debug, const Union::Properties::StyleProperty &type)
bool operator==(const Union::Properties::StyleProperty &left, const Union::Properties::StyleProperty &right)

Detailed Description

This class contains all the properties that are used to style an element.

Member Function Documentation

StyleProperty::StyleProperty()

Default constructor. Constructs a null instance.

A null instance in this case means an instance that does not have any values for its properties. This includes property groups.

StyleProperty::StyleProperty(const Union::Properties::StyleProperty &other)

Copy constructor.

StyleProperty::StyleProperty(Union::Properties::StyleProperty &&other)

Move constructor.

std::optional<Union::Properties::BackgroundProperty> StyleProperty::background() const

Returns the value of background.

See also setBackground().

Union::Properties::BackgroundProperty StyleProperty::background_or_new() const

Returns background if set or a new BackgroundProperty if not.

std::optional<Union::Properties::BorderProperty> StyleProperty::border() const

Returns the value of border.

See also setBorder().

Union::Properties::BorderProperty StyleProperty::border_or_new() const

Returns border if set or a new BorderProperty if not.

std::optional<Union::Properties::CornersProperty> StyleProperty::corners() const

Returns the value of corners.

See also setCorners().

Union::Properties::CornersProperty StyleProperty::corners_or_new() const

Returns corners if set or a new CornersProperty if not.

[static] Union::Properties::StyleProperty StyleProperty::empty()

Create and return an empty StyleProperty instance.

This will create an empty StyleProperty instance, which is defined as an instance with all of its values default-constructed. Note that this is different from a default-constructed instance which will have all its values unset.

bool StyleProperty::hasAnyValue() const

Returns if this property group has any value set.

Note that for any property that is also a property group, this will also check if that group has any value.

std::optional<Union::Properties::IconProperty> StyleProperty::icon() const

Returns the value of icon.

See also setIcon().

Union::Properties::IconProperty StyleProperty::icon_or_new() const

Returns icon if set or a new IconProperty if not.

std::optional<Union::Properties::LayoutProperty> StyleProperty::layout() const

Returns the value of layout.

See also setLayout().

Union::Properties::LayoutProperty StyleProperty::layout_or_new() const

Returns layout if set or a new LayoutProperty if not.

std::optional<Union::Properties::OutlineProperty> StyleProperty::outline() const

Returns the value of outline.

See also setOutline().

Union::Properties::OutlineProperty StyleProperty::outline_or_new() const

Returns outline if set or a new OutlineProperty if not.

[static] void StyleProperty::resolveProperties(const Union::Properties::StyleProperty &source, Union::Properties::StyleProperty &destination)

Copy property values from source to destination if destination does not have a property value.

This will recursively copy property values of grouped properties.

source The source property group to copy from. destination The destination property group to copy to.

void StyleProperty::setBackground(const std::optional<Union::Properties::BackgroundProperty> &newValue)

Set the value of background.

newValue The new value or std::nullopt to unset the value.

See also background().

void StyleProperty::setBorder(const std::optional<Union::Properties::BorderProperty> &newValue)

Set the value of border.

newValue The new value or std::nullopt to unset the value.

See also border().

void StyleProperty::setCorners(const std::optional<Union::Properties::CornersProperty> &newValue)

Set the value of corners.

newValue The new value or std::nullopt to unset the value.

See also corners().

void StyleProperty::setIcon(const std::optional<Union::Properties::IconProperty> &newValue)

Set the value of icon.

newValue The new value or std::nullopt to unset the value.

See also icon().

void StyleProperty::setLayout(const std::optional<Union::Properties::LayoutProperty> &newValue)

Set the value of layout.

newValue The new value or std::nullopt to unset the value.

See also layout().

void StyleProperty::setOutline(const std::optional<Union::Properties::OutlineProperty> &newValue)

Set the value of outline.

newValue The new value or std::nullopt to unset the value.

See also outline().

void StyleProperty::setShadow(const std::optional<Union::Properties::ShadowProperty> &newValue)

Set the value of shadow.

newValue The new value or std::nullopt to unset the value.

See also shadow().

void StyleProperty::setText(const std::optional<Union::Properties::TextProperty> &newValue)

Set the value of text.

newValue The new value or std::nullopt to unset the value.

See also text().

std::optional<Union::Properties::ShadowProperty> StyleProperty::shadow() const

Returns the value of shadow.

See also setShadow().

Union::Properties::ShadowProperty StyleProperty::shadow_or_new() const

Returns shadow if set or a new ShadowProperty if not.

std::optional<Union::Properties::TextProperty> StyleProperty::text() const

Returns the value of text.

See also setText().

Union::Properties::TextProperty StyleProperty::text_or_new() const

Returns text if set or a new TextProperty if not.

Union::Properties::StyleProperty &StyleProperty::operator=(Union::Properties::StyleProperty &&other)

Move assignment operator.

Union::Properties::StyleProperty &StyleProperty::operator=(const Union::Properties::StyleProperty &other)

Copy assignment operator.

Related Non-Members

QDebug operator<<(QDebug debug, const Union::Properties::StyleProperty &type)

QDebug support for StyleProperty.

bool operator==(const Union::Properties::StyleProperty &left, const Union::Properties::StyleProperty &right)

Equality comparison for StyleProperty.