개정판 90bc60db
ID | 90bc60dbd2e3201eede8989cda29908c19846cc0 |
하위 | f8ce05c6 |
fixed an error when delete symbol
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
1962 | 1962 |
result.append(data) |
1963 | 1963 |
# Catch the exception |
1964 | 1964 |
except Exception as ex: |
1965 |
from App import App |
|
1966 |
|
|
1965 | 1967 |
# Roll back any change if something goes wrong |
1966 | 1968 |
conn.rollback() |
1967 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
1969 |
|
|
1970 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
1971 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
1968 | 1972 |
finally: |
1969 | 1973 |
# Close the db connection |
1970 | 1974 |
conn.close() |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
825 | 825 |
self.addMessage.emit(MessageType.Error, message) |
826 | 826 |
|
827 | 827 |
''' |
828 |
@brief |
|
828 |
@brief remove item from tree widget and then remove from scene
|
|
829 | 829 |
@date 2018.05.25 |
830 | 830 |
@author Jeongwoo |
831 | 831 |
''' |
... | ... | |
842 | 842 |
|
843 | 843 |
if item.scene() is not None: item.scene().removeItem(item) |
844 | 844 |
except Exception as ex: |
845 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
845 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
846 |
self.addMessage.emit(MessageType.Error, message) |
|
846 | 847 |
|
847 | 848 |
''' |
848 | 849 |
@brief recognize line |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
10 | 10 |
from PyQt5.QtWidgets import (QApplication, QGraphicsItem) |
11 | 11 |
from PyQt5.QtXml import * |
12 | 12 |
|
13 |
from AppDocData import AppDocData
|
|
13 |
from AppDocData import *
|
|
14 | 14 |
from EngineeringConnectorItem import QEngineeringConnectorItem |
15 | 15 |
from QEngineeringAbstractItem import QEngineeringAbstractItem |
16 | 16 |
|
... | ... | |
267 | 267 |
@date 2018.05.02 |
268 | 268 |
''' |
269 | 269 |
def hoverEnterEvent(self, event): |
270 |
self._savedColor = self.getColor() |
|
271 |
self.setColor(SymbolSvgItem.HIGHLIGHT) |
|
272 |
self.currentCursor = int(Qt.OpenHandCursor) |
|
273 |
cursor = QCursor(Qt.OpenHandCursor) |
|
274 |
QApplication.instance().setOverrideCursor(cursor) |
|
275 |
self.update() |
|
270 |
try: |
|
271 |
self._savedColor = self.getColor() |
|
272 |
self.setColor(SymbolSvgItem.HIGHLIGHT) |
|
273 |
self.currentCursor = int(Qt.OpenHandCursor) |
|
274 |
cursor = QCursor(Qt.OpenHandCursor) |
|
275 |
QApplication.instance().setOverrideCursor(cursor) |
|
276 |
self.update() |
|
276 | 277 |
|
277 |
for attr in self.attrs: |
|
278 |
attr.setDefaultTextColor(Qt.red) |
|
279 |
attr.update() |
|
278 |
for attr in self.attrs: |
|
279 |
attr.setDefaultTextColor(Qt.red) |
|
280 |
attr.update() |
|
281 |
except Exception as ex: |
|
282 |
from App import App |
|
283 |
|
|
284 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
285 |
App.mainWin().addMessage(MessageType.Error, message) |
|
280 | 286 |
|
281 | 287 |
''' |
282 | 288 |
@brief unhighlight connector and attribute |
... | ... | |
885 | 891 |
break |
886 | 892 |
|
887 | 893 |
self.transfer.onRemoved.emit(self) |
888 |
self.scene().removeItem(self) |
|
889 | 894 |
|
890 | 895 |
''' |
891 | 896 |
@brief Return real item position |
내보내기 Unified diff