Union::Properties::SizeProperty Class

class Union::Properties::SizeProperty

A property group representing a set of sizes for cardinal directions. More...

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

Public Functions

SizeProperty()
SizeProperty(const Union::Properties::SizeProperty &other)
SizeProperty(Union::Properties::SizeProperty &&other)
std::optional<qreal> bottom() const
bool hasAnyValue() const
std::optional<qreal> left() const
std::optional<qreal> right() const
void setBottom(const std::optional<qreal> &newValue)
void setLeft(const std::optional<qreal> &newValue)
void setRight(const std::optional<qreal> &newValue)
void setTop(const std::optional<qreal> &newValue)
QMarginsF toMargins() const
std::optional<qreal> top() const
Union::Properties::SizeProperty &operator=(Union::Properties::SizeProperty &&other)
Union::Properties::SizeProperty &operator=(const Union::Properties::SizeProperty &other)

Static Public Members

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

Detailed Description

Member Function Documentation

SizeProperty::SizeProperty()

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.

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

Copy constructor.

SizeProperty::SizeProperty(Union::Properties::SizeProperty &&other)

Move constructor.

std::optional<qreal> SizeProperty::bottom() const

Returns the value of bottom.

See also setBottom().

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

Create and return an empty SizeProperty instance.

This will create an empty SizeProperty 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 SizeProperty::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> SizeProperty::left() const

Returns the value of left.

See also setLeft().

[static] void SizeProperty::resolveProperties(const Union::Properties::SizeProperty &source, Union::Properties::SizeProperty &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.

Returns the value of right.

See also setRight().

void SizeProperty::setBottom(const std::optional<qreal> &newValue)

Set the value of bottom.

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

See also bottom().

void SizeProperty::setLeft(const std::optional<qreal> &newValue)

Set the value of left.

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

See also left().

void SizeProperty::setRight(const std::optional<qreal> &newValue)

Set the value of right.

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

See also right().

void SizeProperty::setTop(const std::optional<qreal> &newValue)

Set the value of top.

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

See also top().

QMarginsF SizeProperty::toMargins() const

Convert a Size property to QMarginsF.

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

std::optional<qreal> SizeProperty::top() const

Returns the value of top.

See also setTop().

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

Move assignment operator.

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

Copy assignment operator.

Related Non-Members

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

QDebug support for SizeProperty.

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

Equality comparison for SizeProperty.