프로젝트

일반

사용자정보

개정판 13502b99

ID13502b99e201373996c80b1fa42caf6825732d83
상위 d9fd0356
하위 a247f3fd

함의성이(가) 약 6년 전에 추가함

issue #655: ocr editor arrow key working

차이점 보기:

DTI_PID/DTI_PID/QtImageViewer.py
19 19
from EngineeringLineItem import QEngineeringLineItem
20 20
from EngineeringTextItem import QEngineeringTextItem
21 21
from EngineeringSpecBreakItem import QEngineeringSpecBreakItem
22
from TrainingEditorDialog import QTrainingEditorDialog
22 23
from SymbolSvgItem import SymbolSvgItem
23 24

  
24 25
__author__ = "Marcel Goldschen-Ohm <marcel.goldschen@gmail.com>"
......
377 378
                if self.command is not None:
378 379
                    self.command.execute(['keyPressEvent', event, []])
379 380
                    if self.command.isTreated: return
381
            if type(self.mainWindow) is QTrainingEditorDialog:
382
                self.mainWindow.keyPressEvent(event)
380 383

  
381 384
            QGraphicsView.keyPressEvent(self, event)
382 385
        except Exception as ex:
DTI_PID/DTI_PID/TrainingEditorDialog.py
295 295
        except Exception as ex:
296 296
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
297 297

  
298
    '''
299
        @brief      key pressed event
300
        @author     euisung
301
        @date       2018.11.05
302
    '''
303
    def keyPressEvent(self, event):
304
        try:
305
            if event.key() == Qt.Key_Left:
306
                for item in self.graphicsViewTrainingDrawing.scene.selectedItems():
307
                    if type(item) is QTrainingBoxItem:
308
                        item.setSelected(False)
309
                for item in self.graphicsViewTrainingDrawing.scene.items():
310
                    if type(item) is QTrainingBoxItem:
311
                        item.setSelected(True)
312
                        break
313
            elif event.key() == Qt.Key_Right:
314
                pass
315
                
316
        except Exception as ex:
317
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
318
            from App import App
319
            from AppDocData import MessageType
320

  
321
            message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)
322
            App.mainWnd().addMessage.emit(MessageType.Error, message)
323
            return None
324

  
298 325
        
299 326
        
300 327

  

내보내기 Unified diff

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