Union::Properties::IconPropertyGroup Class

class Union::Properties::IconPropertyGroup

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

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

Public Functions

IconPropertyGroup()
IconPropertyGroup(const Union::Properties::IconPropertyGroup &other)
IconPropertyGroup(Union::Properties::IconPropertyGroup &&other)
Union::Properties::AlignmentPropertyGroup *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::AlignmentPropertyGroup> &&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::IconPropertyGroup &operator=(Union::Properties::IconPropertyGroup &&other)
Union::Properties::IconPropertyGroup &operator=(const Union::Properties::IconPropertyGroup &other)

Static Public Members

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

Detailed Description

Member Function Documentation

IconPropertyGroup::IconPropertyGroup()

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.

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

Copy constructor.

IconPropertyGroup::IconPropertyGroup(Union::Properties::IconPropertyGroup &&other)

Move constructor.

Union::Properties::AlignmentPropertyGroup *IconPropertyGroup::alignment() const

*

A property group with properties related to alignment.

See also setAlignment().

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

The color of the icon.

See also setColor().

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

Create and return an empty IconPropertyGroup instance.

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

The height of the icon.

See also setHeight().

bool IconPropertyGroup::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> IconPropertyGroup::name() const

The name of an icon of the icon theme to use for this icon.

See also setName().

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

Set the value of alignment.

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

See also alignment().

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

A URL to a file to use for the icon. Currently only local files are supported.

See also setSource().

QString IconPropertyGroup::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> IconPropertyGroup::width() const

The width of the icon.

See also setWidth().

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

Move assignment operator.

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

Copy assignment operator.

Related Non-Members

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

QDebug support for IconPropertyGroup.

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

Equality comparison for IconPropertyGroup.