mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-05 20:20:52 +01:00
Cross ref item, check properties for show power contacts or not.
Change properties in project is applied immediately to cross ref git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2985 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -35,10 +35,12 @@ CrossRefItem::CrossRefItem(Element *elmt, QGraphicsItem *parent) :
|
||||
QGraphicsObject(parent),
|
||||
element_ (elmt)
|
||||
{
|
||||
m_properties = elmt->diagram()->defaultXRefProperties();
|
||||
setFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsMovable);
|
||||
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()));
|
||||
updateLabel();
|
||||
}
|
||||
|
||||
@@ -276,7 +278,7 @@ void CrossRefItem::fillCrossRef(QPainter &painter) {
|
||||
|
||||
//find each no and nc of connected element to element_
|
||||
foreach (Element *elmt, element_->linkedElements()) {
|
||||
if (elmt->kindInformations()["type"].toString() == "power") continue;
|
||||
if (elmt->kindInformations()["type"].toString() == "power" && !m_properties.showPowerContact()) continue;
|
||||
QString state = elmt->kindInformations()["state"].toString();
|
||||
if (state == "NO") NO_list << elmt;
|
||||
else if (state == "NC") NC_list << elmt;
|
||||
|
||||
Reference in New Issue
Block a user