프로젝트

일반

사용자정보

개정판 9b514625

ID9b514625e048358785e43d63d74727ec27b02c6b
상위 c4ae884a
하위 fb7c4418

함의성이(가) 5년 이상 전에 추가함

issue #000: arrange code

Change-Id: I1b02c3a47863fa8fb3a9a67424a39af792563ceb

차이점 보기:

DTI_PID/DTI_PID/MainWindow.py
953 953
        if not self.graphicsView.hasImage():
954 954
            self.showImageSelectionMessageBox()
955 955
            return
956
        self.onCommandRejected()
956 957
        self.dlgConfigurationArea = QConfigurationAreaDialog(self)
957 958
        self.dlgConfigurationArea.show()
958 959
        self.dlgConfigurationArea.exec_()
959
        self.graphicsView.useDefaultCommand()
960 960

  
961 961
    '''
962 962
        @brief  configuration
......
1015 1015
                self.showImageSelectionMessageBox()
1016 1016
                return
1017 1017

  
1018
            self.onCommandRejected()
1018 1019
            dialog = QTextDataListDialog(self)
1019 1020
            dialog.show()
1020 1021
            dialog.exec_()
......
1077 1078
            self.path = self.graphicsView.loadImageFromFile(project.getDrawingFilePath(), path if type(path) is str else '')
1078 1079
            if os.path.isfile(self.path):
1079 1080
                appDocData.clear()
1080
                self.graphicsView.useDefaultCommand()
1081
                self.onCommandRejected()
1081 1082

  
1082 1083
                appDocData.setImgFilePath(self.path)
1083 1084
                appDocData.activeDrawing = Drawing(appDocData.imgName)
......
1266 1267
                        for connector in svg.connectors:
1267 1268
                            self.graphicsView.scene.addItem(connector)
1268 1269
        finally:
1269
            self.graphicsView.useDefaultCommand()
1270
            self.onCommandRejected()
1270 1271
            QApplication.restoreOverrideCursor()
1271 1272
    
1272 1273
    '''
......
1334 1335
        @author     humkyung
1335 1336
        @date       2018.07.23
1336 1337
    '''
1337
    def onCommandRejected(self, cmd):
1338
    def onCommandRejected(self, cmd=None):
1338 1339
        try:
1339 1340
            if type(cmd) is PlaceLineCommand.PlaceLineCommand:
1340 1341
                if self.actionLine.tag._polyline:
......
1349 1350
                self.actionOCR.setChecked(False)
1350 1351
            elif type(cmd) is PlacePolygonCommand.PlacePolygonCommand:
1351 1352
                self.actionVendor.setChecked(False)
1353
            else:
1354
                if hasattr(self.actionLine, 'tag') and self.actionLine.tag._polyline:
1355
                    self.graphicsView.scene.removeItem(self.actionLine.tag._polyline)
1356
                    self.graphicsView.scene.update()
1357
                    self.actionLine.tag.reset()
1358
                self.actionLine.setChecked(False)
1359
                self.actionZoom.setChecked(False)
1360
                self.actionOCR.setChecked(False)
1361
                self.actionVendor.setChecked(False)
1352 1362
        finally:
1353 1363
            self.graphicsView.useDefaultCommand()
1354 1364
     
......
1361 1371
    def keyPressEvent(self, event):
1362 1372
        try:
1363 1373
            if event.key() == Qt.Key_Escape:
1364
                checked = self.actionGroup.checkedAction()
1365
                if checked:
1366
                    checked.setChecked(False)
1367
                    self.graphicsView.useDefaultCommand()
1374
                # already catched in command
1375
                pass
1376
                #checked = self.actionGroup.checkedAction()
1377
                #if checked:
1378
                #    checked.setChecked(False)
1379
                #    self.graphicsView.useDefaultCommand()
1368 1380
            elif event.key() == Qt.Key_1:
1369 1381
                if self.actionImage_Drawing.isChecked():
1370 1382
                    self.onViewImageDrawing(False)

내보내기 Unified diff

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