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));
const AttributeType * mType
Definition: attribute.h:102
const AttributeUnit * getUnit() const noexcept
Definition: attribute.h:72
const AttributeType & getType() const noexcept
Definition: attribute.h:71
const QString & getValue() const noexcept
Definition: attribute.h:73
Definition: occmodel.cpp:76
QString mValue
Definition: attribute.h:103
Attribute & operator=(const Attribute &rhs) noexcept
Definition: attribute.cpp:136
bool setKey(const AttributeKey &key) noexcept
Definition: attribute.cpp:77
type_safe::constrained_type< QString, AttributeKeyConstraint, AttributeKeyVerifier > AttributeKey
Definition: attributekey.h:83
Event
Definition: attribute.h:51
Definition: attribute.h:111
bool contains(int index) const noexcept
Definition: serializableobjectlist.h:241
QString getValueTr(bool showUnit) const noexcept
Definition: attribute.cpp:69
bool operator!=(const Attribute &rhs) const noexcept
Definition: attribute.h:92
const AttributeKey & getKey() const noexcept
Definition: attribute.h:67
The AttributeUnit class.
Definition: attributeunit.h:40
librepcb::AttributeList operator|(const librepcb::AttributeList &lhs, const librepcb::AttributeList &rhs) noexcept
Extend an librepcb::AttributeList with additional attributes.
Definition: attribute.h:133
~Attribute() noexcept
Definition: attribute.cpp:62
bool setTypeValueUnit(const AttributeType &type, const QString &value, const AttributeUnit *unit)
Definition: attribute.cpp:87
const QString & getName() const noexcept
Definition: attribute.h:68
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition: attribute.cpp:112
int append(const std::shared_ptr< T > &obj) noexcept
Definition: serializableobjectlist.h:336
const AttributeUnit * mUnit
Definition: attribute.h:104
The Attribute class.
Definition: attribute.h:46
AttributeKey mKey
Definition: attribute.h:101
The Signal class is used to emit signals on non-QObject derived classes.
Definition: signalslot.h:65
Slot< Attribute, Event > OnEditedSlot
Definition: attribute.h:56
The AttributeType class.
Definition: attributetype.h:42
The Slot class is used to receive signals from non-QObject derived classes.
Definition: signalslot.h:36
The SExpression class.
Definition: sexpression.h:66
bool operator==(const Attribute &rhs) const noexcept
Definition: attribute.cpp:128
bool checkAttributesValidity() const noexcept
Definition: attribute.cpp:146
Signal< Attribute, Event > onEdited
Definition: attribute.h:55