개정판 373230bc
issue #000: fix connector color info
Change-Id: I91b7db4bacd0f820cf5490940f96739b80807c94
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
1828 | 1828 |
connector.connectedItem is item]] |
1829 | 1829 |
for match in matches: |
1830 | 1830 |
for connector in match.connectors: |
1831 |
if connector.connectedItem is item: connector.connectedItem = None |
|
1831 |
if connector.connectedItem is item: |
|
1832 |
connector.connectedItem = None |
|
1833 |
connector.highlight(False) |
|
1832 | 1834 |
|
1833 | 1835 |
# matches = [_item for _item in self.graphicsView.scene.items() if hasattr(_item, 'remove_assoc_item')] |
1834 | 1836 |
# for _item in matches: |
DTI_PID/DTI_PID/QtImageViewer.py | ||
---|---|---|
658 | 658 |
connectors = [] |
659 | 659 |
if len(items) > 0 and type(items[0]) is QEngineeringConnectorItem: |
660 | 660 |
scenePos = QPointF(items[0].center()[0], items[0].center()[1]) |
661 |
connectors = [sym for sym in items if issubclass(type(sym.parentItem()), SymbolSvgItem)]
|
|
661 |
connectors = [connector for connector in items if issubclass(type(connector.parentItem()), SymbolSvgItem)]
|
|
662 | 662 |
|
663 | 663 |
matches = [item for item in self.scene.items() if (type(item) is QEngineeringLineItem) and (item.distanceTo((scenePos.x(), scenePos.y())) < 20)] |
664 | 664 |
allowed_error = 0.00001 |
... | ... | |
737 | 737 |
lineConn.transfer.onPosChanged.emit(lineConn) |
738 | 738 |
elif items: |
739 | 739 |
items[0].connectedItem = connectors[0].parentItem() |
740 |
items[0].highlight(False) |
|
740 | 741 |
if connectors[0].connectedItem: |
741 | 742 |
for conn in connectors[0].connectedItem.connectors: |
742 |
if lineConn.connectedItem is connectors[0].parentItem(): |
|
743 |
lineConn.connectedItem = None |
|
743 |
if conn.connectedItem is connectors[0].parentItem(): |
|
744 |
conn.connectedItem = None |
|
745 |
conn.highlight(False) |
|
744 | 746 |
break |
745 | 747 |
connectors[0].connectedItem = svg |
748 |
connectors[0].highlight(False) |
|
746 | 749 |
else: |
747 | 750 |
svg.angle = 0.0 |
748 | 751 |
svg.loc = [round(scenePos.x() - svg.symbolOrigin[0], 1), round(scenePos.y() - svg.symbolOrigin[1], 1)] |
... | ... | |
764 | 767 |
''' |
765 | 768 |
|
766 | 769 |
svg.connectors[0].connectedItem = items[0].parentItem() |
770 |
svg.connectors[0].highlight(False) |
|
767 | 771 |
items[0].connectedItem = svg |
772 |
items[0].highlight(False) |
|
768 | 773 |
|
769 | 774 |
svg.addSvgItemToScene(self.scene) |
770 | 775 |
|
내보내기 Unified diff