개정판 3ebd61eb
issue #000: fixed paint process
Change-Id: Ib58168c9994cc2b36cedbf7bf5799e2bed4d43e2
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py | ||
---|---|---|
9 | 9 |
2018.05.17 Jeongwoo Add DEFAULT_COLOR Variable |
10 | 10 |
''' |
11 | 11 |
DEFAULT_COLOR = '#0000FF' |
12 |
HOVER_COLOR = '#BC4438' |
|
13 | ||
12 | 14 |
def __init__(self, parent=None): |
13 | 15 |
self._color = self.DEFAULT_COLOR # default color |
14 | 16 |
self._owner = None |
17 |
self._hover = False |
|
15 | 18 |
self._area = None |
16 | 19 |
self.connectors = [] |
17 | 20 |
self.attrs = {} # attributes |
18 | 21 |
self._associations = {'Text Item':[], 'Symbol Item':[]} # associated items |
22 |
|
|
23 |
@property |
|
24 |
def hover(self): |
|
25 |
""" |
|
26 |
return hover |
|
27 |
""" |
|
28 |
return self._hover |
|
29 | ||
30 |
@hover.setter |
|
31 |
def hover(self, value): |
|
32 |
""" |
|
33 |
set hover |
|
34 |
""" |
|
35 |
self._hover = value |
|
19 | 36 | |
20 | 37 |
''' |
21 | 38 |
@brief Abstract method. Variable [color] is RGB hex code |
... | ... | |
31 | 48 |
@date 2018.05.11 |
32 | 49 |
''' |
33 | 50 |
def getColor(self): |
34 |
return self._color
|
|
51 |
return QEngineeringAbstractItem.HOVER_COLOR if self.hover else (self._owner._color if self._owner else self._color)
|
|
35 | 52 | |
36 | 53 |
''' |
37 | 54 |
@brief getter of owner |
내보내기 Unified diff