개정판 25879e36
issue #538: fix item drop event
Change-Id: I6ff7173c4e99b584a62c0c05779671807a73f880
DTI_PID/DTI_PID/QtImageViewer.py | ||
---|---|---|
562 | 562 |
scenePos = self.mapToScene(event.pos()) |
563 | 563 |
name = event.mimeData().text() |
564 | 564 |
svg = QtImageViewer.createSymbolObject(name) |
565 |
QtImageViewer.matchSymbolToLine(self.scene(), svg, scenePos) |
|
565 | 566 |
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 | 567 |
svg.setSelected(True) |
570 | 568 |
svg.setFocus() |
571 | 569 |
self.setFocus() # set focus to graphicview |
... | ... | |
718 | 716 |
|
719 | 717 |
# svg.reSettingConnetors() |
720 | 718 |
|
719 |
''' |
|
721 | 720 |
if not strict: |
722 | 721 |
# need fix |
723 | 722 |
App.mainWnd().symbolTreeWidget.clearFocus() |
... | ... | |
728 | 727 |
|
729 | 728 |
svg.setSelected(True) |
730 | 729 |
scene.setFocusItem(svg) |
730 |
''' |
|
731 | 731 |
except Exception as ex: |
732 | 732 |
from App import App |
733 | 733 |
from AppDocData import MessageType |
내보내기 Unified diff