diff --git a/sources/qetgraphicsitem/dynamicelementtextitem.cpp b/sources/qetgraphicsitem/dynamicelementtextitem.cpp index db6340114..a1494f8f0 100644 --- a/sources/qetgraphicsitem/dynamicelementtextitem.cpp +++ b/sources/qetgraphicsitem/dynamicelementtextitem.cpp @@ -1503,7 +1503,8 @@ void DynamicElementTextItem::updateXref() //Remove stale "xref" from elementInformations when no longer needed if(m_parent_element->linkType() == Element::Slave && - m_text_from == ElementInfo && m_info_name == "xref") + m_text_from == ElementInfo && m_info_name == "xref" && + !parentGroup()) { DiagramContext dc = m_parent_element->elementInformations(); if(!dc.value("xref").toString().isEmpty()) diff --git a/sources/qetgraphicsitem/masterelement.cpp b/sources/qetgraphicsitem/masterelement.cpp index 24f12eca8..2c94f2627 100644 --- a/sources/qetgraphicsitem/masterelement.cpp +++ b/sources/qetgraphicsitem/masterelement.cpp @@ -111,7 +111,7 @@ void MasterElement::unlinkElement(Element *elmt) ctx.remove(QETInformation::ELMT_PLC_COMMENT); ctx.remove(QETInformation::ELMT_PLC_CROSSREF); ctx.remove(QETInformation::ELMT_LABEL); - ctx.remove(QStringLiteral("xref")); + ctx.remove(QETInformation::ELMT_XREF); elmt->setElementInformations(ctx); setGroupIndexForElement(elmt, -1); diff --git a/sources/ui/plclinkwidget.cpp b/sources/ui/plclinkwidget.cpp index 545c68b1b..576d85f7c 100644 --- a/sources/ui/plclinkwidget.cpp +++ b/sources/ui/plclinkwidget.cpp @@ -356,8 +356,8 @@ void PlcLinkWidget::on_m_unlink_pb_clicked() LinkElementCommand *undo = new LinkElementCommand(m_element); - // Store the current group index so makeLink() can - // restore PLC variables and terminal labels on undo. + // Store the current group index so makeLink() can + // restore PLC variables and terminal labels on undo. for (Element *elmt : m_element->linkedElements()) { if (elmt->linkType() == Element::Master) diff --git a/sources/undocommand/linkelementcommand.cpp b/sources/undocommand/linkelementcommand.cpp index 19d4dcde7..6b4319a10 100644 --- a/sources/undocommand/linkelementcommand.cpp +++ b/sources/undocommand/linkelementcommand.cpp @@ -254,7 +254,7 @@ void LinkElementCommand::undo() ctx.remove(QETInformation::ELMT_PLC_COMMENT); ctx.remove(QETInformation::ELMT_PLC_CROSSREF); ctx.remove(QETInformation::ELMT_LABEL); - ctx.remove(QStringLiteral("xref")); + ctx.remove(QETInformation::ELMT_XREF); m_element->setElementInformations(ctx); foreach(Element *elmt, m_element->linkedElements()) @@ -292,7 +292,7 @@ void LinkElementCommand::undo() ctx.remove(QETInformation::ELMT_PLC_COMMENT); ctx.remove(QETInformation::ELMT_PLC_CROSSREF); ctx.remove(QETInformation::ELMT_LABEL); - ctx.remove(QStringLiteral("xref")); + ctx.remove(QETInformation::ELMT_XREF); slave->setElementInformations(ctx); } @@ -624,7 +624,7 @@ void LinkElementCommand::makeLink(const QList &element_list) ctx.remove(QETInformation::ELMT_PLC_COMMENT); ctx.remove(QETInformation::ELMT_PLC_CROSSREF); ctx.remove(QETInformation::ELMT_LABEL); - ctx.remove(QStringLiteral("xref")); + ctx.remove(QETInformation::ELMT_XREF); slave->setElementInformations(ctx); } m_element->unlinkElement(elmt);