Union::Properties::LayoutProperty Class

class Union::Properties::LayoutProperty

A property group containing properties related to the layout of an element. More...

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

Public Functions

LayoutProperty()
LayoutProperty(const Union::Properties::LayoutProperty &other)
LayoutProperty(Union::Properties::LayoutProperty &&other)
std::optional<Union::Properties::AlignmentProperty> alignment() const
bool hasAnyValue() const
std::optional<qreal> height() const
std::optional<Union::Properties::SizeProperty> inset() const
std::optional<Union::Properties::SizeProperty> margins() const
std::optional<Union::Properties::SizeProperty> padding() const
void setAlignment(const std::optional<Union::Properties::AlignmentProperty> &newValue)
void setHeight(const std::optional<qreal> &newValue)
void setInset(const std::optional<Union::Properties::SizeProperty> &newValue)
void setMargins(const std::optional<Union::Properties::SizeProperty> &newValue)
void setPadding(const std::optional<Union::Properties::SizeProperty> &newValue)
void setSpacing(const std::optional<qreal> &newValue)
void setWidth(const std::optional<qreal> &newValue)
std::optional<qreal> spacing() const
std::optional<qreal> width() const
Union::Properties::LayoutProperty &operator=(Union::Properties::LayoutProperty &&other)
Union::Properties::LayoutProperty &operator=(const Union::Properties::LayoutProperty &other)

Static Public Members

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

Detailed Description

Member Function Documentation

LayoutProperty::LayoutProperty()

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.

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

Copy constructor.

LayoutProperty::LayoutProperty(Union::Properties::LayoutProperty &&other)

Move constructor.

std::optional<Union::Properties::AlignmentProperty> LayoutProperty::alignment() const

Returns the value of alignment.

See also setAlignment().

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

Create and return an empty LayoutProperty instance.

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

Returns the value of height.

See also setHeight().

std::optional<Union::Properties::SizeProperty> LayoutProperty::inset() const

Returns the value of inset.

See also setInset().

std::optional<Union::Properties::SizeProperty> LayoutProperty::margins() const

Returns the value of margins.

See also setMargins().

std::optional<Union::Properties::SizeProperty> LayoutProperty::padding() const

Returns the value of padding.

See also setPadding().

[static] void LayoutProperty::resolveProperties(const Union::Properties::LayoutProperty &source, Union::Properties::LayoutProperty &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 LayoutProperty::setAlignment(const std::optional<Union::Properties::AlignmentProperty> &newValue)

Set the value of alignment.

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

See also alignment().

void LayoutProperty::setHeight(const std::optional<qreal> &newValue)

Set the value of height.

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

See also height().

void LayoutProperty::setInset(const std::optional<Union::Properties::SizeProperty> &newValue)

Set the value of inset.

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

See also inset().

void LayoutProperty::setMargins(const std::optional<Union::Properties::SizeProperty> &newValue)

Set the value of margins.

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

See also margins().

void LayoutProperty::setPadding(const std::optional<Union::Properties::SizeProperty> &newValue)

Set the value of padding.

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

See also padding().

void LayoutProperty::setSpacing(const std::optional<qreal> &newValue)

Set the value of spacing.

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

See also spacing().

void LayoutProperty::setWidth(const std::optional<qreal> &newValue)

Set the value of width.

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

See also width().

std::optional<qreal> LayoutProperty::spacing() const

Returns the value of spacing.

See also setSpacing().

std::optional<qreal> LayoutProperty::width() const

Returns the value of width.

See also setWidth().

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

Move assignment operator.

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

Copy assignment operator.

Related Non-Members

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

QDebug support for LayoutProperty.

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

Equality comparison for LayoutProperty.