개정판 db336ebd
issue #641: fixed the function to show count of items
Change-Id: I9d5f568da2be7397ea51594aaeaa4d2999bdb184
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
255 | 255 |
self.actionImport_Text_From_CAD.triggered.connect(self.onImportTextFromCAD) |
256 | 256 |
self.actionSymbol_Thickness_Reinforcement.triggered.connect(self.onSymbolThickness) |
257 | 257 |
self.actionHelp.triggered.connect(self.on_help) |
258 |
self.graphicsView.scene.contents_changed.connect(self.onSceneChanged) |
|
259 | 258 |
self.graphicsView.scene.selectionChanged.connect(self.onSelectionChanged) |
260 | 259 |
self.actionInitialize.triggered.connect(self.onInitializeScene) |
261 | 260 |
self.actionSave.triggered.connect(self.actionSaveCliked) |
... | ... | |
583 | 582 |
self.dlgTextItemEdit.show() |
584 | 583 |
self.dlgTextItemEdit.exec_() |
585 | 584 |
|
586 |
''' |
|
587 |
@brief show unknownitem's count |
|
588 |
@author humkyung |
|
589 |
@date 2018.08.23 |
|
590 |
@history humkyung 2018.08.30 display count of symbol, line, text |
|
591 |
''' |
|
585 |
def display_number_of_items(self): |
|
586 |
"""display count of symbol, line, text""" |
|
592 | 587 |
|
593 |
def onSceneChanged(self): |
|
594 | 588 |
items = [item for item in self.graphicsView.scene.items() if type(item) is QEngineeringUnknownItem] |
595 | 589 |
if len(items) > 0: |
596 | 590 |
self.labelStatus.setText( |
... | ... | |
851 | 845 |
def scene_changed(self): |
852 | 846 |
"""update modified flag""" |
853 | 847 |
|
848 |
self.display_number_of_items() |
|
849 |
|
|
854 | 850 |
app_doc_data = AppDocData.instance() |
855 | 851 |
app_doc_data.activeDrawing.modified = True |
856 | 852 |
title = self.windowTitle() |
... | ... | |
1332 | 1328 |
else: |
1333 | 1329 |
self.load_drawing(app_doc_data.activeDrawing) |
1334 | 1330 |
|
1331 |
self.display_number_of_items() |
|
1335 | 1332 |
# connect scene changed signal |
1336 | 1333 |
self.graphicsView.scene.contents_changed.connect(self.scene_changed) |
1337 | 1334 |
finally: |
내보내기 Unified diff