Union::Properties::IconProperty Class

class Union::Properties::IconProperty

A property group containing properties related to an element's icon. More...

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

Public Functions

IconProperty()
IconProperty(const Union::Properties::IconProperty &other)
IconProperty(Union::Properties::IconProperty &&other)
Union::Properties::AlignmentProperty *alignment() const
std::optional<Union::Color> color() const
bool hasAnyValue() const
std::optional<qreal> height() const
bool isEmpty() const
std::optional<QString> name() const
void setAlignment(std::unique_ptr<Union::Properties::AlignmentProperty> &&newValue)
void setColor(const std::optional<Union::Color> &newValue)
void setHeight(const std::optional<qreal> &newValue)
void setName(const std::optional<QString> &newValue)
void setSource(const std::optional<QUrl> &newValue)
void setWidth(const std::optional<qreal> &newValue)
std::optional<QUrl> source() const
QString toString(int indentation = 0, Union::Properties::ToStringFlags flags = ToStringFlags{}) const
std::optional<qreal> width() const
Union::Properties::IconProperty &operator=(Union::Properties::IconProperty &&other)
Union::Properties::IconProperty &operator=(const Union::Properties::IconProperty &other)

Static Public Members

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

Detailed Description

Member Function Documentation

IconProperty::IconProperty()

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.

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

Copy constructor.

IconProperty::IconProperty(Union::Properties::IconProperty &&other)

Move constructor.

Union::Properties::AlignmentProperty *IconProperty::alignment() const

Returns alignment if set or nullptr if not.

See also setAlignment().

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

Returns the value of color.

See also setColor().

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

Create and return an empty IconProperty instance.

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

Returns the value of height.

See also setHeight().

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

std::optional<QString> IconProperty::name() const

Returns the value of name.

See also setName().

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

Set the value of alignment.

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

See also alignment().

void IconProperty::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 IconProperty::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 IconProperty::setName(const std::optional<QString> &newValue)

Set the value of name.

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

See also name().

void IconProperty::setSource(const std::optional<QUrl> &newValue)

Set the value of source.

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

See also source().

void IconProperty::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<QUrl> IconProperty::source() const

Returns the value of source.

See also setSource().

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

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

Returns the value of width.

See also setWidth().

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

Move assignment operator.

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

Copy assignment operator.

Related Non-Members

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

QDebug support for IconProperty.

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

Equality comparison for IconProperty.