프로젝트

일반

사용자정보

개정판 436fcd01

ID436fcd0196678a8bfe5142dba92844f47c453bdc
상위 4680a45b
하위 f70c69e8

백흠경이(가) 4년 이상 전에 추가함

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

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