개정판 596529f3
add attr freeze func
Change-Id: I69c9eac1e0261ca5c95766c9a883cd2b5c33f79e
DTI_PID/DTI_PID/QtImageViewerScene.py | ||
---|---|---|
138 | 138 |
item.keyPressEvent(event) |
139 | 139 |
event.accept() |
140 | 140 |
return |
141 |
elif event.key() == Qt.Key_A: |
|
141 |
elif event.key() == Qt.Key_A or event.key() == Qt.Key_G:
|
|
142 | 142 |
lines = [item for item in self.selectedItems() if type(item) == QEngineeringLineItem] |
143 | 143 |
symbols = [item for item in self.selectedItems() if issubclass(type(item), SymbolSvgItem)] |
144 | 144 |
texts = [item for item in self.selectedItems() if issubclass(type(item), QEngineeringTextItem)] |
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
1466 | 1466 |
self.reverse(True) |
1467 | 1467 |
elif event.key() == Qt.Key_A: |
1468 | 1468 |
self.toggleFlowMark() |
1469 |
elif event.key() == Qt.Key_G: |
|
1470 |
self.freeze_attriute() |
|
1469 | 1471 |
elif event.key() == Qt.Key_Up: # translate up/down/left/right symbol |
1470 | 1472 |
modifiers = QApplication.keyboardModifiers() |
1471 | 1473 |
delta = 10 if modifiers == Qt.ControlModifier else 1 |
... | ... | |
1499 | 1501 |
|
1500 | 1502 |
App.mainWnd().keyPressEvent(event) |
1501 | 1503 |
|
1504 |
def freeze_attriute(self, flag=None): |
|
1505 |
from App import App |
|
1506 |
|
|
1507 |
if flag is None: |
|
1508 |
freeze = True |
|
1509 |
for _attr, _value in self.attrs.items(): |
|
1510 |
if _attr.Freeze: |
|
1511 |
freeze = False |
|
1512 |
break |
|
1513 |
|
|
1514 |
for _attr, _value in self.attrs.items(): |
|
1515 |
_attr.Freeze = freeze |
|
1516 |
|
|
1517 |
App.mainWnd().resultPropertyTableWidget.onSuccessSelectAttribute(self) |
|
1518 |
else: |
|
1519 |
for _attr, _value in self.attrs.items(): |
|
1520 |
_attr.Freeze = flag |
|
1521 |
|
|
1502 | 1522 |
def toggleFlowMark(self): |
1503 | 1523 |
from AppDocData import AppDocData |
1504 | 1524 |
|
... | ... | |
2179 | 2199 |
splitAction.triggered.connect(lambda: self.contextSplit(event.pos())) |
2180 | 2200 |
menu.addAction(splitAction) |
2181 | 2201 |
|
2202 |
freezeAttrAction = QAction('Freeze Attributes(G)', None) |
|
2203 |
freezeAttrAction.triggered.connect(self.freeze_attriute) |
|
2204 |
menu.addAction(freezeAttrAction) |
|
2205 |
|
|
2182 | 2206 |
freezeAction = QAction('Set Freeze', None) if not self.prop('Freeze') else QAction('Unset Freeze', None) |
2183 | 2207 |
freezeAction.triggered.connect(self.contextFreeze) |
2184 | 2208 |
menu.addAction(freezeAction) |
DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py | ||
---|---|---|
189 | 189 |
explodeKeepAction.triggered.connect(self.contextExplodeKeep) |
190 | 190 |
menu.addAction(explodeKeepAction) |
191 | 191 |
|
192 |
freezeAction = QAction("Freeze Attributes of All Child Items" , None) |
|
193 |
freezeAction.triggered.connect(lambda: self.freeze_attriute(True)) |
|
194 |
menu.addAction(freezeAction) |
|
195 |
|
|
196 |
unfreezeAction = QAction("Un-Freeze Attributes of All Child Items" , None) |
|
197 |
unfreezeAction.triggered.connect(lambda: self.freeze_attriute(False)) |
|
198 |
menu.addAction(unfreezeAction) |
|
199 |
|
|
192 | 200 |
fromAction = QAction('Set From(S)', None) |
193 | 201 |
fromAction.triggered.connect(self.contextFrom) |
194 | 202 |
menu.addAction(fromAction) |
... | ... | |
281 | 289 |
for lineNo in lineNos: |
282 | 290 |
lineNo.setSelected(True) |
283 | 291 |
|
292 |
def freeze_attriute(self, freeze): |
|
293 |
for run in self.runs: |
|
294 |
for item in run.items: |
|
295 |
item.freeze_attriute(freeze) |
|
296 |
|
|
284 | 297 |
def contextShow(self): |
285 | 298 |
self.lineNoFromToIndicatorShowFlag = not self.lineNoFromToIndicatorShowFlag |
286 | 299 |
if self.lineNoFromToIndicatorShowFlag: |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
1279 | 1279 |
elif event.key() == Qt.Key_N: |
1280 | 1280 |
delta = 40 if modifiers == Qt.ControlModifier else 10 |
1281 | 1281 |
self.move_near_main_line(delta) |
1282 |
elif event.key() == Qt.Key_G: |
|
1283 |
self.freeze_attriute() |
|
1282 | 1284 |
elif event.key() == Qt.Key_B: |
1283 | 1285 |
if type(self) is not QEngineeringEndBreakItem: |
1284 | 1286 |
self.bind_close_items() |
... | ... | |
1423 | 1425 |
moveAction.triggered.connect(self.contextMove) |
1424 | 1426 |
menu.addAction(moveAction) |
1425 | 1427 |
|
1428 |
freezeAction = QAction('Freeze Attributes(G)', None) |
|
1429 |
freezeAction.triggered.connect(self.freeze_attriute) |
|
1430 |
menu.addAction(freezeAction) |
|
1431 |
|
|
1426 | 1432 |
replaceAction = QAction('Replace This to Selected Symbol(I, Q)', None) |
1427 | 1433 |
replaceAction.triggered.connect(self.contextReplace) |
1428 | 1434 |
menu.addAction(replaceAction) |
... | ... | |
1611 | 1617 |
event = QKeyEvent(QEvent.KeyPress, Qt.Key_F, Qt.NoModifier) |
1612 | 1618 |
self.scene().keyPressEvent(event) |
1613 | 1619 |
|
1620 |
def freeze_attriute(self, flag=None): |
|
1621 |
from App import App |
|
1622 |
|
|
1623 |
if flag is None: |
|
1624 |
freeze = True |
|
1625 |
for _attr, _value in self.attrs.items(): |
|
1626 |
if _attr.Freeze: |
|
1627 |
freeze = False |
|
1628 |
break |
|
1629 |
|
|
1630 |
for _attr, _value in self.attrs.items(): |
|
1631 |
_attr.Freeze = freeze |
|
1632 |
|
|
1633 |
App.mainWnd().resultPropertyTableWidget.onSuccessSelectAttribute(self) |
|
1634 |
else: |
|
1635 |
for _attr, _value in self.attrs.items(): |
|
1636 |
_attr.Freeze = flag |
|
1637 |
|
|
1614 | 1638 |
def move_near_main_line(self, length): |
1615 | 1639 |
from EngineeringLineItem import QEngineeringLineItem |
1616 | 1640 |
from EngineeringTextItem import QEngineeringTextItem |
내보내기 Unified diff