개정판 13502b99
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