개정판 667d66ee
QGraphicsPolylineItem.setColor() 내에 setPen 메소드 적용 / 라인넘버 색상 변경 후 Scene 변경 시 하위 아이템들 색상 변경
DTI_PID/DTI_PID/Shapes/QEngineeringLineItem.py | ||
---|---|---|
18 | 18 |
class QEngineeringLineItem(QGraphicsPolylineItem): |
19 | 19 |
removed = pyqtSignal(QGraphicsPathItem) |
20 | 20 |
|
21 |
''' |
|
22 |
@history 2018.05.11 Jeongwoo Make Comments self.setPen() |
|
23 |
''' |
|
21 | 24 |
def __init__(self, parent=None): |
22 | 25 |
QGraphicsPolylineItem.__init__(self, parent) |
23 | 26 |
|
24 | 27 |
self.conns = [None, None] |
25 | 28 |
|
26 |
self.setPen(QPen(Qt.blue, 5, Qt.SolidLine)) |
|
29 |
#self.setPen(QPen(Qt.blue, 5, Qt.SolidLine))
|
|
27 | 30 |
self.setFlags(QGraphicsItem.ItemIsSelectable|QGraphicsItem.ItemIsFocusable) |
28 | 31 |
|
29 | 32 |
self.setAcceptHoverEvents(True) |
DTI_PID/DTI_PID/Shapes/QGraphicsPolylineItem.py | ||
---|---|---|
110 | 110 |
@brief Set Color. Override QEngineeringAbstractItem's |
111 | 111 |
@author Jeongwoo |
112 | 112 |
@date 2018.05.11 |
113 |
@history 2018.05.11 Jeongwoo Add self.setPen() Method |
|
113 | 114 |
''' |
114 | 115 |
def setColor(self, color): |
115 | 116 |
c = QColor() |
116 | 117 |
c.setNamedColor(color) |
117 | 118 |
self.pen.setColor(c) |
119 |
self.setPen(self.pen) |
|
118 | 120 |
self.update(self.boundingRect()) |
119 | 121 |
pass |
120 | 122 |
|
내보내기 Unified diff