프로젝트

일반

사용자정보

개정판 14608af0

ID14608af041c6991b06cb65995862a0d8aec825bc
상위 b8109b41
하위 9f104970, fe0bc5d7

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

issue #000: add text multi move

Change-Id: I7b4f567a2bd0bf47fae0168ddba9fdd86ed97cae

차이점 보기:

DTI_PID/DTI_PID/MainWindow.py
961 961
                        height = textInfo.getH()
962 962
                        item = TextItemFactory.instance().createTextItem(textInfo)
963 963
                        if item is not None:
964
                            item.loc = (x, y)
964
                            item.loc = [x, y]
965 965
                            item.size = (width, height)
966 966
                            item.angle = angle
967 967
                            item.setDefaultTextColor(Qt.blue)
......
1496 1496
                height = textInfo.getH()
1497 1497
                item = TextItemFactory.instance().createTextItem(textInfo)
1498 1498
                if item is not None:
1499
                    item.loc = (x, y)
1499
                    item.loc = [x, y]
1500 1500
                    item.size = (width, height)
1501 1501
                    item.angle = angle
1502 1502
                    item.setDefaultTextColor(Qt.blue)
......
1871 1871
                item = TextItemFactory.instance().createTextItem(textInfo)
1872 1872

  
1873 1873
                if item is not None:
1874
                    item.loc = (x, y)
1874
                    item.loc = [x, y]
1875 1875
                    item.size = (width, height)
1876 1876
                    item.angle = angle
1877 1877
                    item.area = textInfo[0]
......
2006 2006

  
2007 2007
                item = TextItemFactory.instance().createTextItem(textInfo)
2008 2008
                if item is not None:
2009
                    item.loc = (x, y)
2009
                    item.loc = [x, y]
2010 2010
                    item.size = (width, height)
2011 2011
                    item.angle = angle
2012 2012
                    item.area = 'Drawing'
......
2044 2044

  
2045 2045
                    item = TextItemFactory.instance().createTextItem(textInfo)
2046 2046

  
2047
                    item.loc = (x, y)
2047
                    item.loc = [x, y]
2048 2048
                    item.size = (width, height)
2049 2049
                    item.angle = angle
2050 2050
                    item.area = textInfoMap[0]
DTI_PID/DTI_PID/QtImageViewer.py
397 397
            if type(self.mainWindow) is QTrainingEditorDialog:
398 398
                self.mainWindow.keyPressEvent(event)
399 399

  
400
            if event.key() == Qt.Key_Up or event.key() == Qt.Key_Down or event.key() == Qt.Key_Left or event.key() == Qt.Key_Right:
401
                items = [text for text in self.scene.selectedItems() if issubclass(type(text), QEngineeringTextItem)] #or issubclass(type(text), SymbolSvgItem)]
402
                if len(items) > 1:
403
                    for item in items:
404
                        item.keyPressEvent(event)
405
                    return
406

  
400 407
            QGraphicsView.keyPressEvent(self, event)
401 408
        except Exception as ex:
402 409
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py
130 130
        """ reverse line routine when user press 'C' key """
131 131
        if event.key() == Qt.Key_C:
132 132
            self.reverse()
133
        
134
        QEngineeringTextItem.keyPressEvent(self, event)
133 135

  
134 136
    def update_flow_mark(self, position, minLength):
135 137
        """ update line flow mark """
......
330 332
                    item.attrs[attr] = attr_node.text
331 333

  
332 334
                item.uid = uuid.UUID(node.find('UID').text, version=4)
333
                item.loc = (x, y)
335
                item.loc = [x, y]
334 336
                item.size = (width, height)
335 337
                item.angle = angle
336 338
                #item.setToolTip('<b>{}</b><br>LINE NO={}'.format(str(item.uid), text))
DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py
172 172

  
173 173
            width = self.size[0]
174 174
            height = self.size[1]
175
            self.size = (height, width)
175
            self.size = [height, width]
176 176

  
177 177
            self.rotate()
178
        elif event.key() == Qt.Key_Up:  ### translate up/down/left/right symbol
179
            self.loc[1] = self.loc[1] - 1
180
            self.rotate()
181
        elif event.key() == Qt.Key_Down:
182
            self.loc[1] = self.loc[1] + 1
183
            self.rotate()
184
        elif event.key() == Qt.Key_Left:
185
            self.loc[0] = self.loc[0] - 1
186
            self.rotate()    
187
        elif event.key() == Qt.Key_Right:
188
            self.loc[0] = self.loc[0] + 1
189
            self.rotate()
178 190

  
179
        QGraphicsTextItem.keyPressEvent(self, event)
191
        #QGraphicsTextItem.keyPressEvent(self, event)
180 192

  
181 193
    '''
182 194
        @brief  draw rect when item is selected
......
269 281
                height = textInfo.getH()
270 282
                item = TextItemFactory.instance().createTextItem(textInfo)
271 283
                if item is not None:
272
                    item.loc = (x, y)
284
                    item.loc = [x, y]
273 285
                    item.size = (width, height)
274 286
                    item.angle = angle
275 287
                    item.area = self.area
......
471 483
            
472 484
            item = TextItemFactory.instance().createTextItem(textInfo)
473 485
            if item is not None:
474
                    item.loc = (x, y)
475
                    item.size = (width, height)
486
                    item.loc = [x, y]
487
                    item.size = [width, height]
476 488
                    item.angle = angle
477 489
            '''
478 490
            if name == 'NOTE':

내보내기 Unified diff

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