프로젝트

일반

사용자정보

개정판 3ba37adf

ID3ba37adf6f3b6097c753a2987aa5ea01f6868a69
상위 46e67073
하위 06adc70d, 8c5431cc

humkyung 이(가) 약 7년 전에 추가함

Add QEngineeringTextItem

차이점 보기:

DTI_PID/DTI_PID/Shapes/QEngineeringTextItem.py
1
# coding: utf-8
2
import os.path
3
import copy
4
try:
5
    from PyQt5.QtCore import Qt, QPointF, QRectF, pyqtSignal, QT_VERSION_STR
6
    from PyQt5.QtGui import QImage, QPixmap, QPainterPath, QBrush, QPen, QTransform
7
    from PyQt5.QtWidgets import QGraphicsView, QGraphicsScene, QFileDialog, QGraphicsItem, QAbstractGraphicsShapeItem, QGraphicsTextItem
8
except ImportError:
9
    try:
10
        from PyQt4.QtCore import Qt, QRectF, pyqtSignal, QT_VERSION_STR
11
        from PyQt4.QtGui import QGraphicsView, QGraphicsScene, QImage, QPixmap, QPainterPath, QFileDialog
12
    except ImportError:
13
        raise ImportError("ImageViewerQt: Requires PyQt5 or PyQt4.")
14

  
15
from QGraphicsPolylineItem import QGraphicsPolylineItem
16
from QGraphicsBoundingBoxItem import QGraphicsBoundingBoxItem
17

  
18
class QEngineeringTextItem(QGraphicsTextItem):
19
    def __init__(self, parent=None):
20
        QGraphicsTextItem.__init__(self, parent)
21

  
22
        self.setFlags(QGraphicsItem.ItemIsSelectable)
23
        self.setAcceptHoverEvents(True)
24

  
25
    def hoverEnterEvent(self, event):
26
        pass
27

  
28
    def hoverLeaveEvent(self, event):
29
        pass
30

  
31
    def hoverMoveEvent(self, event):
32
        pass

내보내기 Unified diff