Union::Properties::ShadowPropertyGroup Class

class Union::Properties::ShadowPropertyGroup

A property group containing properties relating to an element's shadow. More...

Header: #include <ShadowPropertyGroup.h>
CMake: find_package(Union REQUIRED)
target_link_libraries(mytarget PRIVATE Union::Union)

Public Functions

ShadowPropertyGroup()
ShadowPropertyGroup(const Union::Properties::ShadowPropertyGroup &other)
ShadowPropertyGroup(Union::Properties::ShadowPropertyGroup &&other)
std::optional<qreal> blur() const
std::optional<Union::Color> color() const
bool hasAnyValue() const
bool isEmpty() const
Union::Properties::OffsetPropertyGroup *offset() const
void setBlur(const std::optional<qreal> &newValue)
void setColor(const std::optional<Union::Color> &newValue)
void setOffset(std::unique_ptr<Union::Properties::OffsetPropertyGroup> &&newValue)
void setSize(const std::optional<qreal> &newValue)
std::optional<qreal> size() const
QString toString(int indentation = 0, Union::Properties::ToStringFlags flags = ToStringFlags{}) const
Union::Properties::ShadowPropertyGroup &operator=(Union::Properties::ShadowPropertyGroup &&other)
Union::Properties::ShadowPropertyGroup &operator=(const Union::Properties::ShadowPropertyGroup &other)

Static Public Members

std::unique_ptr<Union::Properties::ShadowPropertyGroup> empty()
void resolveProperties(const Union::Properties::ShadowPropertyGroup *source, Union::Properties::ShadowPropertyGroup *destination)
QDebug operator<<(QDebug debug, Union::Properties::ShadowPropertyGroup *type)
bool operator==(const Union::Properties::ShadowPropertyGroup &left, const Union::Properties::ShadowPropertyGroup &right)

Detailed Description

Member Function Documentation

ShadowPropertyGroup::ShadowPropertyGroup()

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.

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

Copy constructor.

ShadowPropertyGroup::ShadowPropertyGroup(Union::Properties::ShadowPropertyGroup &&other)

Move constructor.

std::optional<qreal> ShadowPropertyGroup::blur() const

The amount of blur to use for the shadow. Increasing this will increase how smooth the shadow goes from fully transparent to the full shadow color.

See also setBlur().

std::optional<Union::Color> ShadowPropertyGroup::color() const

The color of the shadow.

See also setColor().

[static] std::unique_ptr<Union::Properties::ShadowPropertyGroup> ShadowPropertyGroup::empty()

Create and return an empty ShadowPropertyGroup instance.

This will create an empty ShadowPropertyGroup 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 ShadowPropertyGroup::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.

bool ShadowPropertyGroup::isEmpty() const

Returns if this property is considered empty.

A property is considered empty if it has no values or if the values it contains are all considered empty values.

Union::Properties::OffsetPropertyGroup *ShadowPropertyGroup::offset() const

* The offset of the shadow from its element. Setting this will move the entire shadow, as if the light were cast from a different angle.

See also setOffset().

[static] void ShadowPropertyGroup::resolveProperties(const Union::Properties::ShadowPropertyGroup *source, Union::Properties::ShadowPropertyGroup *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 ShadowPropertyGroup::setBlur(const std::optional<qreal> &newValue)

Set the value of blur.

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

See also blur().

void ShadowPropertyGroup::setColor(const std::optional<Union::Color> &newValue)

Set the value of color.

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

See also color().

void ShadowPropertyGroup::setOffset(std::unique_ptr<Union::Properties::OffsetPropertyGroup> &&newValue)

Set the value of offset.

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

See also offset().

void ShadowPropertyGroup::setSize(const std::optional<qreal> &newValue)

Set the value of size.

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

See also size().

std::optional<qreal> ShadowPropertyGroup::size() const

The size of the shadow. This expands the area used for the shadow compared to the element.

See also setSize().

QString ShadowPropertyGroup::toString(int indentation = 0, Union::Properties::ToStringFlags flags = ToStringFlags{}) const

Returns a string representation of this property group.

This is intended for debugging.

indentation The amount of indentation to apply. Defaults to 0. flags A set of flags that control conversion behavior.

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

Move assignment operator.

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

Copy assignment operator.

Related Non-Members

QDebug operator<<(QDebug debug, Union::Properties::ShadowPropertyGroup *type)

QDebug support for ShadowPropertyGroup.

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

Equality comparison for ShadowPropertyGroup.