프로젝트

일반

사용자정보

개정판 18a0281b

ID18a0281b719b7c2dc7888ddc4403417293030ac2
상위 a8cd73f2
하위 67c067d3

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

ImageViewer에서 svg 클릭 시 TreeWidget에서 검색하는 기능 구현 중

차이점 보기:

DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
9 9
from PyQt5.QtWidgets import (QGraphicsItem)
10 10

  
11 11
class SymbolSvgItem(QGraphicsSvgItem):
12
    clicked = pyqtSignal(QGraphicsSvgItem)
13

  
12 14
    '''
13
        @history    18.04.11    Jeongwoo    Add Variable (Name)
15
        @history    18.04.11    Jeongwoo    Add Variable (Name, Type)
14 16
    '''
15 17
    def __init__(self, path):
16 18
        super(SymbolSvgItem, self).__init__(path)
......
19 21
                      #QGraphicsItem.ItemIsMovable)
20 22
        
21 23
        self.name = ''
24
        self.type = ''
22 25
        self.angle = 0
23 26
        self.loc = None
24 27
        self.size = None
25 28

  
26 29
        self.setAcceptHoverEvents(True)
30
        self.setAcceptedMouseButtons(Qt.LeftButton)
27 31

  
28 32
    '''
29 33
        @brief  return bounding box of symbol
......
58 62
        print('Leave')
59 63

  
60 64
    def hoverMoveEvent(self, event):
61
        return #print('Moving')
65
        return #print('Moving')
66

  
67
    '''
68
        @brief      Mouse Press Event
69
        @author     Jeongwoo
70
        @date       18.04.11
71
        @history    .
72
    '''
73
    def mousePressEvent(self, event):
74
        print("Clicked!!!! " + self.name)
75
        self.clicked.emit(self)

내보내기 Unified diff

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