Union::Properties::LayoutPropertyGroup Class
class Union::Properties::LayoutPropertyGroupA property group containing properties related to the layout of an element. More...
| Header: | #include <LayoutPropertyGroup.h> |
| CMake: | find_package(Union REQUIRED)target_link_libraries(mytarget PRIVATE Union::Union) |
Public Functions
| LayoutPropertyGroup() | |
| LayoutPropertyGroup(const Union::Properties::LayoutPropertyGroup &other) | |
| LayoutPropertyGroup(Union::Properties::LayoutPropertyGroup &&other) | |
| Union::Properties::AlignmentPropertyGroup * | alignment() const |
| bool | hasAnyValue() const |
| std::optional<qreal> | height() const |
| Union::Properties::SizePropertyGroup * | inset() const |
| bool | isEmpty() const |
| Union::Properties::SizePropertyGroup * | margins() const |
| Union::Properties::SizePropertyGroup * | padding() const |
| void | setAlignment(std::unique_ptr<Union::Properties::AlignmentPropertyGroup> &&newValue) |
| void | setHeight(const std::optional<qreal> &newValue) |
| void | setInset(std::unique_ptr<Union::Properties::SizePropertyGroup> &&newValue) |
| void | setMargins(std::unique_ptr<Union::Properties::SizePropertyGroup> &&newValue) |
| void | setPadding(std::unique_ptr<Union::Properties::SizePropertyGroup> &&newValue) |
| void | setSpacing(const std::optional<qreal> &newValue) |
| void | setWidth(const std::optional<qreal> &newValue) |
| std::optional<qreal> | spacing() const |
| QString | toString(int indentation = 0, Union::Properties::ToStringFlags flags = ToStringFlags{}) const |
| std::optional<qreal> | width() const |
| Union::Properties::LayoutPropertyGroup & | operator=(Union::Properties::LayoutPropertyGroup &&other) |
| Union::Properties::LayoutPropertyGroup & | operator=(const Union::Properties::LayoutPropertyGroup &other) |
Static Public Members
| std::unique_ptr<Union::Properties::LayoutPropertyGroup> | empty() |
| void | resolveProperties(const Union::Properties::LayoutPropertyGroup *source, Union::Properties::LayoutPropertyGroup *destination) |
Related Non-Members
| QDebug | operator<<(QDebug debug, Union::Properties::LayoutPropertyGroup *type) |
| bool | operator==(const Union::Properties::LayoutPropertyGroup &left, const Union::Properties::LayoutPropertyGroup &right) |
Detailed Description
Member Function Documentation
LayoutPropertyGroup::LayoutPropertyGroup()
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.
LayoutPropertyGroup::LayoutPropertyGroup(const Union::Properties::LayoutPropertyGroup &other)
Copy constructor.
LayoutPropertyGroup::LayoutPropertyGroup(Union::Properties::LayoutPropertyGroup &&other)
Move constructor.
Union::Properties::AlignmentPropertyGroup *LayoutPropertyGroup::alignment() const
Returns alignment if set or nullptr if not.
See also setAlignment().
[static] std::unique_ptr<Union::Properties::LayoutPropertyGroup> LayoutPropertyGroup::empty()
Create and return an empty LayoutPropertyGroup instance.
This will create an empty LayoutPropertyGroup 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 LayoutPropertyGroup::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> LayoutPropertyGroup::height() const
The implicit (initial) height of an element.
See also setHeight().
Union::Properties::SizePropertyGroup *LayoutPropertyGroup::inset() const
Returns inset if set or nullptr if not.
See also setInset().
bool LayoutPropertyGroup::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.
Union::Properties::SizePropertyGroup *LayoutPropertyGroup::margins() const
Margins define extra spacing between sub-elements of an element.
See also setMargins().
Union::Properties::SizePropertyGroup *LayoutPropertyGroup::padding() const
Returns padding if set or nullptr if not.
See also setPadding().
[static] void LayoutPropertyGroup::resolveProperties(const Union::Properties::LayoutPropertyGroup *source, Union::Properties::LayoutPropertyGroup *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 LayoutPropertyGroup::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 LayoutPropertyGroup::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 LayoutPropertyGroup::setInset(std::unique_ptr<Union::Properties::SizePropertyGroup> &&newValue)
Set the value of inset.
newValue The new value or std::nullopt to unset the value.
See also inset().
void LayoutPropertyGroup::setMargins(std::unique_ptr<Union::Properties::SizePropertyGroup> &&newValue)
Set the value of margins.
newValue The new value or std::nullopt to unset the value.
See also margins().
void LayoutPropertyGroup::setPadding(std::unique_ptr<Union::Properties::SizePropertyGroup> &&newValue)
Set the value of padding.
newValue The new value or std::nullopt to unset the value.
See also padding().
void LayoutPropertyGroup::setSpacing(const std::optional<qreal> &newValue)
Set the value of spacing.
newValue The new value or std::nullopt to unset the value.
See also spacing().
void LayoutPropertyGroup::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<qreal> LayoutPropertyGroup::spacing() const
The spacing between various elements.
See also setSpacing().
QString LayoutPropertyGroup::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> LayoutPropertyGroup::width() const
The implicit (initial) width of an element.
See also setWidth().
Union::Properties::LayoutPropertyGroup &LayoutPropertyGroup::operator=(Union::Properties::LayoutPropertyGroup &&other)
Move assignment operator.
Union::Properties::LayoutPropertyGroup &LayoutPropertyGroup::operator=(const Union::Properties::LayoutPropertyGroup &other)
Copy assignment operator.
Related Non-Members
QDebug operator<<(QDebug debug, Union::Properties::LayoutPropertyGroup *type)
QDebug support for LayoutPropertyGroup.
bool operator==(const Union::Properties::LayoutPropertyGroup &left, const Union::Properties::LayoutPropertyGroup &right)
Equality comparison for LayoutPropertyGroup.