개정판 b89eca62
issue #000: fixed connector color when first time loading
Change-Id: I2ab2545943f2e814632bcc56d244598ee81f19e1
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
1628 | 1628 |
|
1629 | 1629 |
try: |
1630 | 1630 |
self.dlgConnectAttr = QConnectAttrDialog(self, self.graphicsView) |
1631 |
self.dlgConnectAttr.exec_() |
|
1632 |
|
|
1633 |
self.itemTreeWidget.InitLineNoItems() |
|
1634 |
|
|
1635 |
# construct line no item |
|
1636 |
line_nos = [item for item in self.graphicsView.scene.items() if type(item) is QEngineeringLineNoTextItem] |
|
1637 |
for line_no in line_nos: |
|
1638 |
item = self.itemTreeWidget.addTreeItem(self.itemTreeWidget.root, line_no) |
|
1639 |
connectedItems = line_no.getConnectedItems() |
|
1640 |
for connectedItem in connectedItems: |
|
1641 |
if issubclass(type(connectedItem), SymbolSvgItem): |
|
1642 |
self.itemTreeWidget.addTreeItem(item, connectedItem) |
|
1643 |
# up to here |
|
1631 |
if QDialog.Accepted == self.dlgConnectAttr.exec_(): |
|
1632 |
self.itemTreeWidget.InitLineNoItems() |
|
1633 |
|
|
1634 |
# construct line no item |
|
1635 |
line_nos = [item for item in self.graphicsView.scene.items() if type(item) is QEngineeringLineNoTextItem] |
|
1636 |
for line_no in line_nos: |
|
1637 |
item = self.itemTreeWidget.addTreeItem(self.itemTreeWidget.root, line_no) |
|
1638 |
connectedItems = line_no.getConnectedItems() |
|
1639 |
for connectedItem in connectedItems: |
|
1640 |
if issubclass(type(connectedItem), SymbolSvgItem): |
|
1641 |
self.itemTreeWidget.addTreeItem(item, connectedItem) |
|
1642 |
# up to here |
|
1643 |
|
|
1644 |
self.graphicsView.scene.update(self.graphicsView.sceneRect()) |
|
1644 | 1645 |
except Exception as ex: |
1645 | 1646 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
1646 | 1647 |
self.addMessage.emit(MessageType.Error, message) |
DTI_PID/DTI_PID/Shapes/EngineeringConnectorItem.py | ||
---|---|---|
441 | 441 |
self.connectPoint = (float(connectPointStr[0]), float(connectPointStr[1])) |
442 | 442 |
self.sceneConnectPoint = (float(sceneConnectPointStr[0]), float(sceneConnectPointStr[1])) |
443 | 443 |
|
444 |
self.setBrush(Qt.yellow) if self.connectedItem else self.setBrush(Qt.blue) |
|
444 |
self.setBrush(Qt.yellow) if self._connectedItem else self.setBrush(Qt.blue)
|
|
445 | 445 |
except Exception as ex: |
446 | 446 |
from App import App |
447 | 447 |
from AppDocData import MessageType |
내보내기 Unified diff