cross ref item: bugfix

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3035 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-04-28 19:00:49 +00:00
parent f9aaff37a2
commit 1cd9c4b28c
4 changed files with 33 additions and 60 deletions

View File

@@ -40,7 +40,7 @@ CrossRefItem::CrossRefItem(Element *elmt, QGraphicsItem *parent) :
connect(elmt, SIGNAL(positionChange(QPointF)), this, SLOT(autoPos()));
connect(elmt, SIGNAL(elementInfoChange(DiagramContext)), this, SLOT(updateLabel()));
connect(elmt->diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
connect(elmt->diagram(), SIGNAL(XRefPropertiesChanged(XRefProperties)), this, SLOT(updateLabel()));
connect(elmt->diagram(), SIGNAL(XRefPropertiesChanged(XRefProperties)), this, SLOT(setProperties(XRefProperties)));
updateLabel();
}
@@ -52,6 +52,7 @@ CrossRefItem::~CrossRefItem() {
disconnect(m_element, SIGNAL(positionChange(QPointF)), this, SLOT(autoPos()));
disconnect(m_element, SIGNAL(elementInfoChange(DiagramContext)), this, SLOT(updateLabel()));
disconnect(m_element->diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
disconnect(m_element->diagram(), SIGNAL(XRefPropertiesChanged(XRefProperties)), this, SLOT(setProperties(XRefProperties)));
}
/**
@@ -70,6 +71,13 @@ QPainterPath CrossRefItem::shape() const{
return m_shape_path;
}
void CrossRefItem::setProperties(XRefProperties xrp) {
if (m_properties != xrp) {
m_properties = xrp;
updateLabel();
}
}
/**
* @brief CrossRefItem::updateLabel
* Update the content of the item