Implement slave contact groups — label transfer, terminal assignment and UI fixes

This commit is contained in:
Kellermorph
2026-07-17 09:47:32 +02:00
parent b543adcb46
commit b025bd205d
29 changed files with 1305 additions and 31 deletions
+19 -1
View File
@@ -62,6 +62,20 @@ class Element : public QetGraphicsItem
Thumbnail = 64,
ConductorDefinition = 128};
/**
* @brief The LinkInfo struct
* Stores link data for element connections.
* For slave elements, group_index indicates which contact group
* of the master this slave is assigned to (-1 = no group assigned).
*/
struct LinkInfo {
QUuid uuid;
int group_index = -1; ///< Index into master's slaveContactGroups, -1 = not assigned
LinkInfo() = default;
LinkInfo(const QUuid &u, int gi = -1) : uuid(u), group_index(gi) {}
};
Element(const ElementsLocation &location,
QGraphicsItem * = nullptr,
int *state = nullptr,
@@ -181,6 +195,9 @@ class Element : public QetGraphicsItem
virtual void initLink(QETProject *);
QList<Element *> linkedElements ();
int groupIndexForElement(Element *elmt) const;
void setGroupIndexForElement(Element *elmt, int index);
/**
* @brief linkType
* use elementData function instead
@@ -228,7 +245,8 @@ class Element : public QetGraphicsItem
protected:
//ATTRIBUTES related to linked element
QList <Element *> connected_elements;
QList <QUuid> tmp_uuids_link;
QList <LinkInfo> tmp_uuids_link;
QHash <Element *, int> m_group_index_map; ///< Maps linked elements to their group index (for slave->master links)
QUuid m_uuid;
kind m_link_type = Element::Simple;