프로젝트

일반

사용자정보

개정판 3828d206

ID3828d206c13bb0a89c55e1c8e9ee69a8fe920248
상위 4088fb74
하위 4c216689

김정우 이(가) 약 7년 전에 추가함

QSymbolEditorDialog 에 즉시 삽입 옵션 추가 / 즉시 삽입 옵션 추가와 관련 부분 수정 / InsertSymbol 내에 함수 표기가 잘못되어 저장되지 않는 문제 수정

차이점 보기:

DTI_PID/DTI_PID/Commands/CropCommand.py
14 14
class CropCommand(AbstractCommand.AbstractCommand):
15 15
    def __init__(self, imageViewer):
16 16
        super(CropCommand, self).__init__(imageViewer)
17
        self.name = 'Crop' 
17
        self.name = 'Crop'
18
        self.offsetX = 0
19
        self.offsetY = 0
18 20
        self.imageViewer.setCursor(QCursor(Qt.CrossCursor))
19 21
    
20 22
    '''
21 23
        @brief  crop image by rectangle selected by user
24
        @history    2018.05.02  Jeongwoo    Init self.offsetX and self.offsetY
25
                                            Add QtImageViewer.startPointChanged.emit
22 26
    '''
23 27
    def execute(self, param):
24 28
        event = param[1]
......
34 38
                selectionBBox = self.imageViewer.scene.selectionArea().boundingRect().intersected(viewBBox)
35 39
                if selectionBBox.isValid():
36 40
                    croppedImage = self.imageViewer.image().copy(selectionBBox.toAlignedRect())
41
                    self.offsetX = selectionBBox.x()
42
                    self.offsetY = selectionBBox.y()
37 43
                    self.imageViewer.setImage(croppedImage)
38 44
            finally:
39 45
                self.imageViewer.setDragMode(QGraphicsView.NoDrag)
40 46
                self.imageViewer.leftMouseButtonReleased.emit(scenePos.x(), scenePos.y())
47
                self.imageViewer.startPointChanged.emit(self.offsetX, self.offsetY)
41 48
                pass
42 49
        self.isTreated = False
43 50

  

내보내기 Unified diff