개정판 436fcd01
issue #538: enable key event right after creating symbol by drag-drop
Change-Id: Ic6bcb9c4b151345b4ad4fe6396dc6578e527281c
DTI_PID/DTI_PID/QtImageViewer.py | ||
---|---|---|
546 | 546 |
|
547 | 547 |
event.acceptProposedAction() |
548 | 548 |
|
549 |
''' |
|
550 |
@brief drop event |
|
551 |
@author humkyung |
|
552 |
@date 2018.04.17 |
|
553 |
@history 2018.06.08 Jeongwoo Add Paramter on SymbolSvgItem.buildItem() |
|
554 |
humkyung 2018.08.21 call hoverLeaveEvent if item exists under mouse |
|
555 |
''' |
|
556 |
|
|
557 | 549 |
def dropEvent(self, event): |
550 |
"""drop a symbol""" |
|
558 | 551 |
from AppDocData import AppDocData |
559 | 552 |
import symbol |
560 | 553 |
|
... | ... | |
569 | 562 |
scenePos = self.mapToScene(event.pos()) |
570 | 563 |
name = event.mimeData().text() |
571 | 564 |
svg = QtImageViewer.createSymbolObject(name) |
572 |
QtImageViewer.matchSymbolToLine(self.scene(), svg, scenePos) |
|
565 |
if svg: |
|
566 |
svg.origin = [scenePos.x(), scenePos.y()] |
|
567 |
svg.loc = [svg.origin[0] - svg.symbolOrigin[0], svg.origin[1] - svg.symbolOrigin[1]] |
|
568 |
svg.addSvgItemToScene(self.scene(), undoable=True) |
|
569 |
svg.setSelected(True) |
|
570 |
svg.setFocus() |
|
571 |
self.setFocus() # set focus to graphicview |
|
573 | 572 |
|
574 | 573 |
event.acceptProposedAction() |
575 | 574 |
|
내보내기 Unified diff