프로젝트

일반

사용자정보

개정판 78ca21fd

ID78ca21fddbf08529918320ceee8da978281723d6
상위 2d03ade2
하위 4c632ac9

함의성이(가) 약 5년 전에 추가함

issue #643: add text remove

Change-Id: I04e498a2ee40360c792da64fe1436a76be0d89e0

차이점 보기:

DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py
167 167
    '''
168 168

  
169 169
    def keyPressEvent(self, event):
170
        if self.isSelected() and event.key() == Qt.Key_Delete:
171
            self.deleteTextItemFromScene()
172
        elif event.key() == Qt.Key_R:
170
        if event.key() == Qt.Key_R:
173 171
            # degree 0
174 172
            if 0 == self.angle:
175 173
                self.angle = 1.57
......
257 255
    '''
258 256

  
259 257
    def deleteTextItemFromScene(self):
258
        ''' not used '''
260 259
        # self.transfer.onRemoved.emit(self)
261 260
        self.scene().removeItem(self)
262 261

  
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
1002 1002

  
1003 1003
        if not self.isSelected():
1004 1004
            return
1005
        if event.key() == Qt.Key_Delete:
1006
            self.deleteSvgItemFromScene()
1007
        elif event.key() == Qt.Key_B:
1005
        if event.key() == Qt.Key_B:
1008 1006
            self.bind_close_items()
1009 1007
        elif event.key() == Qt.Key_R and type(self) is not QEngineeringErrorItem:
1010 1008
            self.rotateSymbol()
......
1904 1902
    '''
1905 1903

  
1906 1904
    def deleteSvgItemFromScene(self):
1905
        ''' not used '''
1907 1906
        for connector in self.connectors:
1908 1907
            if connector.connectedItem is not None:
1909 1908
                try:
DTI_PID/DTI_PID/TextItemEditDialog.py
87 87
        text_find = self.ui.lineEditFindText.text()
88 88
        replace = self.ui.lineEditReplaceText.text()
89 89
        model = self.ui.tableViewResult.model()
90
        if replace and model.rowCount():
90
        if model.rowCount():
91 91
            messages = []
92 92
            for row in range(model.rowCount()):
93 93
                item = self.ui.tableViewResult.model().item(row, 0)
......
96 96
                    text = data.text()
97 97
                    messages.append(f"replaced: {text} --> {text.replace(text_find, replace)}")
98 98
                    data.setPlainText(text.replace(text_find, replace))
99
                    if not data.text():
100
                        data.transfer.onRemoved.emit(data)
99 101

  
100 102
            if messages:
101 103
                QMessageBox.information(self, self.tr('Information'), '\r\n'.join(messages))

내보내기 Unified diff

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