개정판 0b9c35fe
issue #000: when item deleted from scene assoc and attr item will free
Change-Id: Ia22460c68702f754045ef94e45ddaf4de81c47ec
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
1604 | 1604 |
if match.owner is item: |
1605 | 1605 |
match.owner = None |
1606 | 1606 |
|
1607 |
matches = [_item for _item in self.graphicsView.scene.items() if hasattr(_item, 'attrs')] |
|
1608 |
done = False |
|
1609 |
for match in matches: |
|
1610 |
for assoc in match.associations(): |
|
1611 |
if item is assoc: |
|
1612 |
match.remove_assoc_item(item) |
|
1613 |
for attr in match.attrs.keys(): |
|
1614 |
if str(item.uid) == str(attr.AssocItem.uid): |
|
1615 |
attr.AssocItem = None |
|
1616 |
match.attrs[attr] = '' |
|
1617 |
done = True |
|
1618 |
break |
|
1619 |
break |
|
1620 |
if done: break |
|
1621 |
|
|
1607 | 1622 |
if item.scene() is not None: item.scene().removeItem(item) |
1608 | 1623 |
except Exception as ex: |
1609 | 1624 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
내보내기 Unified diff