mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-02 18:14:13 +02:00
Implement slave contact groups — label transfer, terminal assignment and UI fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user