mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-15 14:19:59 +01:00
Unlink a slave element, reset her text to "_".
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4885 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
SlaveElement::SlaveElement(const ElementsLocation &location, QGraphicsItem *qgi, int *state) :
|
SlaveElement::SlaveElement(const ElementsLocation &location, QGraphicsItem *qgi, int *state) :
|
||||||
CustomElement(location, qgi, state)
|
CustomElement(location, qgi, state)
|
||||||
{
|
{
|
||||||
Xref_item = nullptr;
|
m_xref_item = nullptr;
|
||||||
link_type_ = Slave;
|
link_type_ = Slave;
|
||||||
connect(this, SIGNAL(updateLabel()), this, SLOT(updateLabel()));
|
connect(this, SIGNAL(updateLabel()), this, SLOT(updateLabel()));
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,10 @@ void SlaveElement::unlinkElement(Element *elmt)
|
|||||||
disconnect(elmt -> diagram(), SIGNAL(XRefPropertiesChanged()), this, SLOT(updateLabel()));
|
disconnect(elmt -> diagram(), SIGNAL(XRefPropertiesChanged()), this, SLOT(updateLabel()));
|
||||||
disconnect(elmt, SIGNAL(updateLabel()), this, SLOT(updateLabel()));
|
disconnect(elmt, SIGNAL(updateLabel()), this, SLOT(updateLabel()));
|
||||||
|
|
||||||
delete Xref_item; Xref_item = NULL;
|
delete m_xref_item; m_xref_item = NULL;
|
||||||
|
|
||||||
|
if (ElementTextItem *eti = this->taggedText("label"))
|
||||||
|
eti->setPlainText("_");
|
||||||
|
|
||||||
updateLabel();
|
updateLabel();
|
||||||
elmt -> unlinkElement (this) ;
|
elmt -> unlinkElement (this) ;
|
||||||
@@ -144,16 +147,20 @@ void SlaveElement::updateLabel()
|
|||||||
Xreflabel = autonum::AssignVariables::formulaToLabel(Xreflabel, elmt->rSequenceStruct(), elmt->diagram(), elmt);
|
Xreflabel = autonum::AssignVariables::formulaToLabel(Xreflabel, elmt->rSequenceStruct(), elmt->diagram(), elmt);
|
||||||
label = autonum::AssignVariables::formulaToLabel(label, elmt->rSequenceStruct(), elmt->diagram(), elmt);
|
label = autonum::AssignVariables::formulaToLabel(label, elmt->rSequenceStruct(), elmt->diagram(), elmt);
|
||||||
}
|
}
|
||||||
else label = autonum::AssignVariables::formulaToLabel(label, m_autoNum_seq, diagram(), this);
|
else
|
||||||
|
label = autonum::AssignVariables::formulaToLabel(label, m_autoNum_seq, diagram(), this);
|
||||||
|
|
||||||
// set the new label
|
// set the new label
|
||||||
ElementTextItem *eti = setTaggedText("label", label, no_editable);
|
ElementTextItem *eti = setTaggedText("label", label, no_editable);
|
||||||
if (eti && !isFree()) {
|
if (eti && !isFree())
|
||||||
if (Xref_item) Xref_item -> setPlainText(Xreflabel);
|
{
|
||||||
else {
|
if (m_xref_item)
|
||||||
Xref_item = new QGraphicsTextItem(Xreflabel, eti);
|
m_xref_item->setPlainText(Xreflabel);
|
||||||
Xref_item -> setFont(QETApp::diagramTextsFont(5));
|
else
|
||||||
Xref_item -> setPos(eti -> boundingRect().bottomLeft());
|
{
|
||||||
|
m_xref_item = new QGraphicsTextItem(Xreflabel, eti);
|
||||||
|
m_xref_item->setFont(QETApp::diagramTextsFont(5));
|
||||||
|
m_xref_item->setPos(eti -> boundingRect().bottomLeft());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class SlaveElement : public CustomElement
|
|||||||
void updateLabel();
|
void updateLabel();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QGraphicsTextItem *Xref_item;
|
QGraphicsTextItem *m_xref_item;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SLAVEELEMENT_H
|
#endif // SLAVEELEMENT_H
|
||||||
|
|||||||
Reference in New Issue
Block a user