Union::Properties::OffsetPropertyGroup Class

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

Public Functions

OffsetPropertyGroup()
OffsetPropertyGroup(const Union::Properties::OffsetPropertyGroup &other)
OffsetPropertyGroup(Union::Properties::OffsetPropertyGroup &&other)
bool hasAnyValue() const
std::optional<qreal> horizontal() const
bool isEmpty() const
void setHorizontal(const std::optional<qreal> &newValue)
void setVertical(const std::optional<qreal> &newValue)
QString toString(int indentation = 0, Union::Properties::ToStringFlags flags = ToStringFlags{}) const
QVector2D toVector2D() const
std::optional<qreal> vertical() const
Union::Properties::OffsetPropertyGroup &operator=(Union::Properties::OffsetPropertyGroup &&other)
Union::Properties::OffsetPropertyGroup &operator=(const Union::Properties::OffsetPropertyGroup &other)

Static Public Members

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

Detailed Description

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.

Member Function Documentation

OffsetPropertyGroup::OffsetPropertyGroup()

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.

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

Copy constructor.

OffsetPropertyGroup::OffsetPropertyGroup(Union::Properties::OffsetPropertyGroup &&other)

Move constructor.

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

Create and return an empty OffsetPropertyGroup instance.

This will create an empty OffsetPropertyGroup 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 OffsetPropertyGroup::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<qreal> OffsetPropertyGroup::horizontal() const

The horizontal offset of the shadow.

See also setHorizontal().

bool OffsetPropertyGroup::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.

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

Set the value of horizontal.

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

See also horizontal().

void OffsetPropertyGroup::setVertical(const std::optional<qreal> &newValue)

Set the value of vertical.

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

See also vertical().

QString OffsetPropertyGroup::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.

QVector2D OffsetPropertyGroup::toVector2D() const

Convert an Offset property to QVector2D.

If any values are not set, they will use 0.0.

std::optional<qreal> OffsetPropertyGroup::vertical() const

The vertical offset of the shadow.

See also setVertical().

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

Move assignment operator.

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

Copy assignment operator.

Related Non-Members

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

QDebug support for OffsetPropertyGroup.

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

Equality comparison for OffsetPropertyGroup.