프로젝트

일반

사용자정보

개정판 776e52d3

ID776e52d3d043fd8703eb5b61f9234fe39a347c63
상위 2a6eb268
하위 59dac246

백흠경이(가) 5년 이상 전에 추가함

issue #1047: 객체 삭제

Change-Id: Iafd94789cfd17758802dc2fcb96793d80ca9331f

차이점 보기:

HYTOS/HYTOS/MainWindow.py
1580 1580
        try:
1581 1581
            self.itemTreeWidget.itemRemoved(item)
1582 1582

  
1583
            matches = [_item for _item in self.graphicsView.scene.items() if hasattr(_item, 'connectors') and [connector for connector in _item.connectors if connector.connectedItem is item]]
1583
            matches = [_item for _item in self.graphicsView.scene.items() if hasattr(_item, 'connectors') and \
1584
            [connector for connector in _item.connectors if connector.connectedItem is not None and connector.connectedItem.parentItem() is item]]
1584 1585
            for match in matches:
1585 1586
                for connector in match.connectors:
1586
                    if connector.connectedItem is item: connector.connectedItem = None
1587

  
1588
            #matches = [_item for _item in self.graphicsView.scene.items() if hasattr(_item, 'remove_assoc_item')]
1589
            #for _item in matches:
1590
            #    _item.remove_assoc_item(item)
1587
                    if connector.connectedItem.parentItem() is item: connector.connect(None)
1591 1588

  
1592 1589
            matches = [_item for _item in self.graphicsView.scene.items() if type(_item) is QEngineeringLineNoTextItem]
1593 1590
            for match in matches:
......
1621 1618
                        break
1622 1619
                if done: break
1623 1620

  
1624
            if type(item) is QEngineeringFlowMarkItem and item.parentItem():
1625
                if item in item.parentItem()._flowMark:
1626
                    item.parentItem()._flowMark.pop(item.parentItem()._flowMark.index(item))
1627

  
1628
            if item.scene() is not None: item.scene().removeItem(item)
1621
            if item.scene() is not None:
1622
                item.scene().removeItem(item)
1623
                del item
1629 1624
        except Exception as ex:
1630 1625
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
1631 1626
            self.addMessage.emit(MessageType.Error, message)

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)