개정판 305c4975
add text association validation
Change-Id: I679016eaf7294759002030531a70d034fe9eb5c4
DTI_PID/DTI_PID/QtImageViewerScene.py | ||
---|---|---|
149 | 149 |
if items: |
150 | 150 |
for item in items: |
151 | 151 |
item.keyPressEvent(event) |
152 |
event.accept() |
|
153 |
return |
|
152 | 154 |
elif event.key() == Qt.Key_B or event.key() == Qt.Key_N or event.key() == Qt.Key_Insert: |
153 | 155 |
items = [item for item in self.selectedItems() if issubclass(type(item), SymbolSvgItem)] |
154 | 156 |
if items: |
DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py | ||
---|---|---|
200 | 200 |
app_doc_data = AppDocData.instance() |
201 | 201 |
dataPath = app_doc_data.getErrorItemSvgPath() |
202 | 202 |
|
203 |
if self.owner: |
|
204 |
if self not in self.owner.associations(): |
|
205 |
error = SymbolSvgItem.createItem('Error', None, dataPath) |
|
206 |
error.parent = self |
|
207 |
error.msg = self.tr('Association error') |
|
208 |
error.setToolTip(error.msg) |
|
209 |
error.area = self.area |
|
210 |
error.name = 'Error' |
|
211 |
error.items = [ self.owner ] |
|
212 |
errors.append(error) |
|
213 |
|
|
214 |
error.setPosition([self.sceneBoundingRect().center().x(), self.sceneBoundingRect().center().y()]) |
|
215 |
|
|
203 | 216 |
# check overlapping |
204 | 217 |
texts = [item for item in self.scene().items() if item is not self and issubclass(type(item), QEngineeringTextItem)] |
205 | 218 |
for text in texts: |
내보내기 Unified diff