Union::Properties::TextPropertyGroup Class

class Union::Properties::TextPropertyGroup

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

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

Public Functions

TextPropertyGroup()
TextPropertyGroup(const Union::Properties::TextPropertyGroup &other)
TextPropertyGroup(Union::Properties::TextPropertyGroup &&other)
Union::Properties::AlignmentPropertyGroup *alignment() const
std::optional<Union::Color> color() const
std::optional<Union::Properties::TextElide> elide() const
std::optional<QFont> font() const
bool hasAnyValue() const
bool isEmpty() const
void setAlignment(std::unique_ptr<Union::Properties::AlignmentPropertyGroup> &&newValue)
void setColor(const std::optional<Union::Color> &newValue)
void setElide(const std::optional<Union::Properties::TextElide> &newValue)
void setFont(const std::optional<QFont> &newValue)
void setWrapMode(const std::optional<Union::Properties::TextWrapMode> &newValue)
QString toString(int indentation = 0, Union::Properties::ToStringFlags flags = ToStringFlags{}) const
std::optional<Union::Properties::TextWrapMode> wrapMode() const
Union::Properties::TextPropertyGroup &operator=(Union::Properties::TextPropertyGroup &&other)
Union::Properties::TextPropertyGroup &operator=(const Union::Properties::TextPropertyGroup &other)

Static Public Members

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

Detailed Description

Member Function Documentation

TextPropertyGroup::TextPropertyGroup()

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.

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

Copy constructor.

TextPropertyGroup::TextPropertyGroup(Union::Properties::TextPropertyGroup &&other)

Move constructor.

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

Returns alignment if set or nullptr if not.

See also setAlignment().

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

The color of text of an element.

See also setColor().

std::optional<Union::Properties::TextElide> TextPropertyGroup::elide() const

The elide mode for the text of an element.

See also setElide().

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

Create and return an empty TextPropertyGroup instance.

This will create an empty TextPropertyGroup 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.

std::optional<QFont> TextPropertyGroup::font() const

Returns the value of font.

See also setFont().

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

bool TextPropertyGroup::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 TextPropertyGroup::resolveProperties(const Union::Properties::TextPropertyGroup *source, Union::Properties::TextPropertyGroup *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 TextPropertyGroup::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 TextPropertyGroup::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 TextPropertyGroup::setElide(const std::optional<Union::Properties::TextElide> &newValue)

Set the value of elide.

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

See also elide().

void TextPropertyGroup::setFont(const std::optional<QFont> &newValue)

Set the value of font.

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

See also font().

void TextPropertyGroup::setWrapMode(const std::optional<Union::Properties::TextWrapMode> &newValue)

Set the value of wrapMode.

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

See also wrapMode().

QString TextPropertyGroup::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<Union::Properties::TextWrapMode> TextPropertyGroup::wrapMode() const

The wrap mode for the text of an element.

See also setWrapMode().

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

Move assignment operator.

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

Copy assignment operator.

Related Non-Members

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

QDebug support for TextPropertyGroup.

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

Equality comparison for TextPropertyGroup.