개정판 e519d74b
issue #000: fix recognition and delete scene
Change-Id: If583820ea22249d852913bc1a71a41824b432cea
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
234 | 234 |
self.pushButtonBatchRecognition.setVisible(False) |
235 | 235 |
|
236 | 236 |
# removedItems |
237 |
''' |
|
237 | 238 |
self.removedItems = {} |
238 | 239 |
self.removedItems['LINE'] = [] |
239 | 240 |
self.removedItems['EQUIP'] = [] |
240 | 241 |
self.removedItems['INST'] = [] |
241 | 242 |
self.removedItems['NOTE'] = [] |
243 |
''' |
|
242 | 244 |
|
243 | 245 |
self.delimiter = '"' |
244 | 246 |
|
... | ... | |
803 | 805 |
|
804 | 806 |
msg = QMessageBox() |
805 | 807 |
msg.setIcon(QMessageBox.Critical) |
806 |
msg.setText(self.tr('선택한 인식한 항목들을 삭제하시겠습니까?\n삭제된 항목들은 복구할 수 없습니다.'))
|
|
807 |
msg.setWindowTitle(self.tr("항목 삭제"))
|
|
808 |
msg.setText(self.tr('Do you want to remove all items?\nThis work cannot be recovered.'))
|
|
809 |
msg.setWindowTitle(self.tr("Initialize"))
|
|
808 | 810 |
msg.setStandardButtons(QMessageBox.Ok|QMessageBox.Cancel) |
809 | 811 |
if QMessageBox.Ok == msg.exec_(): |
810 | 812 |
|
811 | 813 |
appDocData = AppDocData.instance() |
812 | 814 |
appDocData.clearItemList(True) |
813 |
|
|
815 |
|
|
814 | 816 |
items = self.graphicsView.scene.items() |
815 | 817 |
for item in items: |
816 |
if type(item) is not QGraphicsPixmapItem: |
|
818 |
if type(item) is not QGraphicsPixmapItem and item.scene() is not None: |
|
819 |
#if hasattr(item, 'tranfer'): |
|
820 |
# item.tranfer.onRemoved.emit(item) |
|
821 |
#else: |
|
822 |
# self.graphicsView.scene.removeItem(item) |
|
817 | 823 |
self.graphicsView.scene.removeItem(item) |
818 | 824 |
|
825 |
''' |
|
819 | 826 |
if type(item) is QEngineeringLineNoTextItem: |
820 | 827 |
self.removedItems['LINE'].append(str(item.uid)) |
821 | 828 |
elif type(item) is QEngineeringInstrumentItem: |
... | ... | |
824 | 831 |
self.removedItems['EQUIP'].append(str(item.uid)) |
825 | 832 |
elif type(item) is QEngineeringNoteItem: |
826 | 833 |
self.removedItems['NOTE'].append(str(item.uid)) |
834 |
''' |
|
827 | 835 |
|
828 | 836 |
if self.path is not None: |
829 | 837 |
baseName = os.path.basename(self.path) |
... | ... | |
1501 | 1509 |
return |
1502 | 1510 |
|
1503 | 1511 |
try: |
1512 |
''' |
|
1504 | 1513 |
self.removedItems['LINE'] = [] |
1505 | 1514 |
self.removedItems['EQUIP'] = [] |
1506 | 1515 |
self.removedItems['INST'] = [] |
1507 | 1516 |
self.removedItems['NOTE'] = [] |
1517 |
''' |
|
1508 | 1518 |
|
1509 | 1519 |
appDocData = AppDocData.instance() |
1510 | 1520 |
|
... | ... | |
1676 | 1686 |
for text in appDocData.texts: |
1677 | 1687 |
self.addTextItemToScene(text) |
1678 | 1688 |
|
1689 |
for lineNo in appDocData.tracerLineNos: |
|
1690 |
self.addTextItemToScene(lineNo) |
|
1691 |
|
|
1679 | 1692 |
for line in appDocData.lines: |
1680 | 1693 |
self.graphicsView.scene.addItem(line) |
1681 | 1694 |
line.transfer.onRemoved.connect(self.itemRemoved) |
DTI_PID/DTI_PID/RecognitionDialog.py | ||
---|---|---|
224 | 224 |
if worker.isTextChecked: |
225 | 225 |
items.extend([item for item in worker.graphicsView.scene.items() if issubclass(type(item), QEngineeringTextItem)]) |
226 | 226 |
for item in items: |
227 |
worker.graphicsView.scene.removeItem(item) |
|
227 |
item.transfer.onRemoved.emit(item) |
|
228 |
#worker.graphicsView.scene.removeItem(item) |
|
229 |
|
|
228 | 230 |
#up to here |
229 | 231 |
|
230 | 232 |
srcList = path |
... | ... | |
539 | 541 |
appDocData = AppDocData.instance() |
540 | 542 |
#remove already existing line and flow arrow item |
541 | 543 |
if not batch: |
542 |
items = [item for item in worker.graphicsView.scene.items() if (type(item) is QEngineeringLineItem) or (type(item) is QEngineeringFlowArrowItem)]
|
|
544 |
items = [item for item in worker.graphicsView.scene.items() if (type(item) is QEngineeringLineItem)] |
|
543 | 545 |
for item in items: |
544 |
worker.graphicsView.scene.removeItem(item) |
|
546 |
item.transfer.onRemoved.emit(item) |
|
547 |
#worker.graphicsView.scene.removeItem(item) |
|
545 | 548 |
|
546 | 549 |
#up to here |
547 | 550 |
|
내보내기 Unified diff