개정판 d3b00721
add line no context functions
Change-Id: I482e0fbd6a535974ffed9cee868a67e097347e69
DTI_PID/DTI_PID/Commands/HighlightCommand.py | ||
---|---|---|
46 | 46 |
if type(param) is QEngineeringRunItem: |
47 | 47 |
rect = None |
48 | 48 |
for item in param.items: |
49 |
if not issubclass(type(item), SymbolSvgItem): continue |
|
49 |
#if not issubclass(type(item), SymbolSvgItem): continue
|
|
50 | 50 |
rect = item.sceneBoundingRect() if rect is None else rect.united(item.sceneBoundingRect()) |
51 | 51 |
|
52 | 52 |
if rect is not None: |
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py | ||
---|---|---|
164 | 164 |
reverseAction.triggered.connect(self.contextReverse) |
165 | 165 |
menu.addAction(reverseAction) |
166 | 166 |
|
167 |
highlightAction = QAction('Highlight', None) |
|
168 |
highlightAction.triggered.connect(lambda: self.contextHighlight(self)) |
|
169 |
menu.addAction(highlightAction) |
|
170 |
|
|
171 |
actions = [] |
|
172 |
for index in range(len(self.runs)): |
|
173 |
actions.append(QAction('Highlight Run ' + str(index + 1), None)) |
|
174 |
|
|
175 |
binding = [lambda index=index: actions[index].triggered.connect(lambda: self.contextHighlight(self.runs[index])) for index in range(len(self.runs))] |
|
176 |
|
|
177 |
for index in range(len(actions)): |
|
178 |
binding[index]() |
|
179 |
menu.addAction(actions[index]) |
|
180 |
|
|
167 | 181 |
editAction = QAction('Edit(Return)', None) |
168 | 182 |
editAction.triggered.connect(self.contextEdit) |
169 | 183 |
menu.addAction(editAction) |
... | ... | |
178 | 192 |
|
179 | 193 |
menu.exec_(event.screenPos()) |
180 | 194 |
|
195 |
def contextHighlight(self, item): |
|
196 |
from App import App |
|
197 |
from HighlightCommand import HighlightCommand |
|
198 |
HighlightCommand(App.mainWnd().graphicsView).execute(item) |
|
199 |
|
|
181 | 200 |
def contextExplode(self): |
182 | 201 |
from App import App |
183 | 202 |
App.mainWnd().itemTreeWidget.explode_line_no(self) |
내보내기 Unified diff