개정판 498cd3ed
issue #1362: add a function to place callout text box - revised
Change-Id: I7ef35272e515700b4edaa306052c74aea3e24c08
HYTOS/HYTOS/Shapes/EngineeringCalloutTextItem.py | ||
---|---|---|
108 | 108 |
def hoverMoveEvent(self, event): |
109 | 109 |
pass |
110 | 110 |
|
111 |
def keyPressEvent(self, event): |
|
112 |
try: |
|
113 |
if event.key() == Qt.Key_Escape: |
|
114 |
self.lost_focus.emit(self) |
|
115 |
self.clearFocus() |
|
116 |
|
|
117 |
super(QEngineeringCalloutTextItem, self).keyPressEvent(event) |
|
118 |
except Exception as ex: |
|
119 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
|
120 |
sys.exc_info()[-1].tb_lineno) |
|
121 |
self.addMessage.emit(MessageType.Error, message) |
|
122 |
|
|
111 | 123 |
def itemChange(self, change, value): |
112 | 124 |
if change == QGraphicsItem.ItemSelectedChange: |
113 | 125 |
self.selected_change.emit(self) |
내보내기 Unified diff