Union::Properties::TextProperty Class

class Union::Properties::TextProperty

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

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

Public Functions

TextProperty()
TextProperty(const Union::Properties::TextProperty &other)
TextProperty(Union::Properties::TextProperty &&other)
std::optional<Union::Properties::AlignmentProperty> alignment() const
std::optional<QFont> font() const
bool hasAnyValue() const
void setAlignment(const std::optional<Union::Properties::AlignmentProperty> &newValue)
void setFont(const std::optional<QFont> &newValue)
Union::Properties::TextProperty &operator=(Union::Properties::TextProperty &&other)
Union::Properties::TextProperty &operator=(const Union::Properties::TextProperty &other)

Static Public Members

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

Detailed Description

Member Function Documentation

TextProperty::TextProperty()

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.

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

Copy constructor.

TextProperty::TextProperty(Union::Properties::TextProperty &&other)

Move constructor.

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

Returns the value of alignment.

See also setAlignment().

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

Create and return an empty TextProperty instance.

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

Returns the value of font.

See also setFont().

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

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

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

Move assignment operator.

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

Copy assignment operator.

Related Non-Members

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

QDebug support for TextProperty.

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

Equality comparison for TextProperty.