Union::Properties::BackgroundPropertyGroup Class
class Union::Properties::BackgroundPropertyGroupA property group containing properties related to an element's background. More...
| Header: | #include <BackgroundPropertyGroup.h> |
| CMake: | find_package(Union REQUIRED)target_link_libraries(mytarget PRIVATE Union::Union) |
Public Functions
| BackgroundPropertyGroup() | |
| BackgroundPropertyGroup(const Union::Properties::BackgroundPropertyGroup &other) | |
| BackgroundPropertyGroup(Union::Properties::BackgroundPropertyGroup &&other) | |
| std::optional<Union::Color> | color() const |
| bool | hasAnyValue() const |
| Union::Properties::ImagePropertyGroup * | image() const |
| bool | isEmpty() const |
| void | setColor(const std::optional<Union::Color> &newValue) |
| void | setImage(std::unique_ptr<Union::Properties::ImagePropertyGroup> &&newValue) |
| QString | toString(int indentation = 0, Union::Properties::ToStringFlags flags = ToStringFlags{}) const |
| Union::Properties::BackgroundPropertyGroup & | operator=(Union::Properties::BackgroundPropertyGroup &&other) |
| Union::Properties::BackgroundPropertyGroup & | operator=(const Union::Properties::BackgroundPropertyGroup &other) |
Static Public Members
| std::unique_ptr<Union::Properties::BackgroundPropertyGroup> | empty() |
| void | resolveProperties(const Union::Properties::BackgroundPropertyGroup *source, Union::Properties::BackgroundPropertyGroup *destination) |
Related Non-Members
| QDebug | operator<<(QDebug debug, Union::Properties::BackgroundPropertyGroup *type) |
| bool | operator==(const Union::Properties::BackgroundPropertyGroup &left, const Union::Properties::BackgroundPropertyGroup &right) |
Detailed Description
Member Function Documentation
BackgroundPropertyGroup::BackgroundPropertyGroup()
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.
BackgroundPropertyGroup::BackgroundPropertyGroup(const Union::Properties::BackgroundPropertyGroup &other)
Copy constructor.
BackgroundPropertyGroup::BackgroundPropertyGroup(Union::Properties::BackgroundPropertyGroup &&other)
Move constructor.
std::optional<Union::Color> BackgroundPropertyGroup::color() const
The background color to use for an element.
See also setColor().
[static] std::unique_ptr<Union::Properties::BackgroundPropertyGroup> BackgroundPropertyGroup::empty()
Create and return an empty BackgroundPropertyGroup instance.
This will create an empty BackgroundPropertyGroup 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 BackgroundPropertyGroup::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.
Union::Properties::ImagePropertyGroup *BackgroundPropertyGroup::image() const
The image to use for an element.
See also setImage().
bool BackgroundPropertyGroup::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 BackgroundPropertyGroup::resolveProperties(const Union::Properties::BackgroundPropertyGroup *source, Union::Properties::BackgroundPropertyGroup *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 BackgroundPropertyGroup::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 BackgroundPropertyGroup::setImage(std::unique_ptr<Union::Properties::ImagePropertyGroup> &&newValue)
Set the value of image.
newValue The new value or std::nullopt to unset the value.
See also image().
QString BackgroundPropertyGroup::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.
Union::Properties::BackgroundPropertyGroup &BackgroundPropertyGroup::operator=(Union::Properties::BackgroundPropertyGroup &&other)
Move assignment operator.
Union::Properties::BackgroundPropertyGroup &BackgroundPropertyGroup::operator=(const Union::Properties::BackgroundPropertyGroup &other)
Copy assignment operator.
Related Non-Members
QDebug operator<<(QDebug debug, Union::Properties::BackgroundPropertyGroup *type)
QDebug support for BackgroundPropertyGroup.
bool operator==(const Union::Properties::BackgroundPropertyGroup &left, const Union::Properties::BackgroundPropertyGroup &right)
Equality comparison for BackgroundPropertyGroup.