20#ifndef LIBREPCB_CORE_ATTRIBUTE_H
21#define LIBREPCB_CORE_ATTRIBUTE_H
26#include "../serialization/serializableobjectlist.h"
74 QString
getValueTr(
bool showUnit)
const noexcept;
93 return !(*
this == rhs);
112 static constexpr const char* tagname =
"attribute";
137 for (
const auto& newAttr : rhs) {
138 if (!result.
contains(newAttr.getName())) {
139 result.
append(std::make_shared<librepcb::Attribute>(newAttr));
librepcb::AttributeList operator|(const librepcb::AttributeList &lhs, const librepcb::AttributeList &rhs) noexcept
Extend an librepcb::AttributeList with additional attributes.
Definition: attribute.h:133
The Attribute class.
Definition: attribute.h:46
Signal< Attribute, Event > onEdited
Definition: attribute.h:55
bool setTypeValueUnit(const AttributeType &type, const QString &value, const AttributeUnit *unit)
Definition: attribute.cpp:87
const AttributeKey & getKey() const noexcept
Definition: attribute.h:67
QString getValueTr(bool showUnit) const noexcept
Definition: attribute.cpp:69
const QString & getName() const noexcept
Definition: attribute.h:68
AttributeKey mKey
Definition: attribute.h:101
Event
Definition: attribute.h:51
bool checkAttributesValidity() const noexcept
Definition: attribute.cpp:146
bool setKey(const AttributeKey &key) noexcept
Definition: attribute.cpp:77
Attribute & operator=(const Attribute &rhs) noexcept
Definition: attribute.cpp:136
QString mValue
Definition: attribute.h:103
const QString & getValue() const noexcept
Definition: attribute.h:73
const AttributeUnit * mUnit
Definition: attribute.h:104
~Attribute() noexcept
Definition: attribute.cpp:62
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition: attribute.cpp:112
bool operator!=(const Attribute &rhs) const noexcept
Definition: attribute.h:92
Slot< Attribute, Event > OnEditedSlot
Definition: attribute.h:56
bool operator==(const Attribute &rhs) const noexcept
Definition: attribute.cpp:128
const AttributeType * mType
Definition: attribute.h:102
const AttributeType & getType() const noexcept
Definition: attribute.h:71
const AttributeUnit * getUnit() const noexcept
Definition: attribute.h:72
The AttributeType class.
Definition: attributetype.h:42
The AttributeUnit class.
Definition: attributeunit.h:40
The SExpression class.
Definition: sexpression.h:69
int append(const std::shared_ptr< T > &obj) noexcept
Definition: serializableobjectlist.h:342
bool contains(int index) const noexcept
Definition: serializableobjectlist.h:244
The Signal class is used to emit signals on non-QObject derived classes.
Definition: signalslot.h:65
The Slot class is used to receive signals from non-QObject derived classes.
Definition: signalslot.h:170
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, AttributeKeyConstraint, AttributeKeyVerifier > AttributeKey
Definition: attributekey.h:84
Definition: attribute.h:111