12 .type = ElementType::Line,
13 .group = ElementGroup::Other,
14 .canChangeAppearance =
true,
18 static_assert(
validate(constraints));
23 meta.pixmapPath = []{
return QStringLiteral(
":/Components/Misc/line.svg"); };
24 meta.titleText = QT_TRANSLATE_NOOP(
"Line",
"LINE");
25 meta.translatedName = QT_TRANSLATE_NOOP(
"Line",
"Line");
26 meta.trContext =
"Line";
28 meta.defaultAppearances = QStringList({
":/Components/Misc/line.svg"});
Singleton factory for all circuit element types.
Self-registering element trait template and compile-time constraint validation.
ElementMetadata metadataFromConstraints(const ElementConstraints &c)
Converts ElementConstraints to an ElementMetadata with all constraint-derived fields set.
constexpr bool validate(const ElementConstraints &c)
Validates element constraints at compile time.
Enums::ElementType ElementType
Graphic element for a decorative line shape (no simulation).
static void registerCreator(ElementType type, std::function< GraphicElement *()> creator)
Registers a creator lambda for type, used by buildElement().
GraphicElement(ElementType type, QGraphicsItem *parent=nullptr)
Constructs a graphic element of the given type, fetching all properties from the metadata registry.
Decorative line element used for annotating circuit diagrams.
Line(QGraphicsItem *parent=nullptr)
Constructs a Line element.
Compile-time-validatable subset of ElementMetadata.
static const bool registered
static constexpr ElementConstraints constraints
static ElementMetadata metadata()
Self-registering element information trait.