개정판 32a21b6d
fix context
Change-Id: If770a6a1bbcd33b4ba7852d08b77a38c232f2afc
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
1016 | 1016 |
from EngineeringAbstractItem import QEngineeringAbstractItem |
1017 | 1017 |
from EngineeringLineItem import QEngineeringLineItem |
1018 | 1018 |
from AppDocData import AppDocData |
1019 |
from App import App |
|
1019 | 1020 |
|
1020 | 1021 |
if self.prop('Freeze') or self.owner or self.prop('Connected Item'): |
1021 | 1022 |
return |
... | ... | |
1067 | 1068 |
self.owner = ownerItem |
1068 | 1069 |
self.set_property('Freeze', True) |
1069 | 1070 |
|
1071 |
App.mainWnd().resultPropertyTableWidget.onSuccessSelectAttribute(self) |
|
1072 |
|
|
1070 | 1073 |
''' |
1071 | 1074 |
@brief remove item when user press delete key |
1072 | 1075 |
@author humkyung |
... | ... | |
1137 | 1140 |
App.mainWnd().keyPressEvent(event) |
1138 | 1141 |
|
1139 | 1142 |
def contextMenuEvent(self, event): |
1143 |
from EngineeringSpecBreakItem import QEngineeringSpecBreakItem |
|
1144 |
|
|
1140 | 1145 |
items = self.scene().selectedItems() |
1141 |
if len(items) == 0 and self in items:
|
|
1146 |
if len(items) == 1 and self in items:
|
|
1142 | 1147 |
menu = QMenu() |
1143 | 1148 |
|
1144 |
bindAction = QAction('Bind(B)', None) |
|
1145 |
bindAction.triggered.connect(self.contextBind) |
|
1146 |
menu.addAction(bindAction) |
|
1149 |
if type(self) != QEngineeringSpecBreakItem: |
|
1150 |
bindAction = QAction('Bind(B)', None) |
|
1151 |
bindAction.triggered.connect(self.contextBind) |
|
1152 |
menu.addAction(bindAction) |
|
1153 |
else: |
|
1154 |
bindAction = QAction('Set Batch(Bind)', None) |
|
1155 |
bindAction.triggered.connect(self.contextBindSpec) |
|
1156 |
menu.addAction(bindAction) |
|
1147 | 1157 |
|
1148 | 1158 |
rotateAction = QAction('Rotate(R)', None) |
1149 | 1159 |
rotateAction.triggered.connect(self.contextRotate) |
... | ... | |
1163 | 1173 |
event = QKeyEvent(QEvent.KeyPress, Qt.Key_Delete, Qt.NoModifier) |
1164 | 1174 |
self.scene().keyPressEvent(event) |
1165 | 1175 |
|
1176 |
def contextBindSpec(self): |
|
1177 |
from App import App |
|
1178 |
if App.mainWnd().on_connect_spec_breaks([self]): |
|
1179 |
App.mainWnd().resultPropertyTableWidget.onSuccessSelectAttribute(self) |
|
1180 |
|
|
1166 | 1181 |
def contextBind(self): |
1167 | 1182 |
event = QKeyEvent(QEvent.KeyPress, Qt.Key_B, Qt.NoModifier) |
1168 | 1183 |
self.keyPressEvent(event) |
... | ... | |
1332 | 1347 |
generate xml code |
1333 | 1348 |
:return: |
1334 | 1349 |
""" |
1335 |
import uuid |
|
1336 | 1350 |
from xml.etree.ElementTree import Element, SubElement, dump, ElementTree |
1337 |
from EngineeringAbstractItem import QEngineeringAbstractItem |
|
1338 |
from EngineeringTextItem import QEngineeringTextItem |
|
1339 |
from EngineeringSpecBreakItem import QEngineeringSpecBreakItem |
|
1340 | 1351 |
from SymbolAttr import SymbolAttr |
1341 | 1352 |
|
1342 | 1353 |
try: |
내보내기 Unified diff