개정판 48dae955
issue #1060: 계산식 예외처리
Change-Id: I673ec380de5cba7bd83688cd560afddae5541124
HYTOS/HYTOS/Commands/DefaultCommand.py | ||
---|---|---|
54 | 54 |
|
55 | 55 |
try: |
56 | 56 |
if not self.isCopy: |
57 |
if 'mousePressEvent' == param[0] and event.button() == Qt.MiddleButton:
|
|
57 |
if 'mousePressEvent' == param[0] and event.button() == Qt.RightButton:
|
|
58 | 58 |
self.imageViewer.setDragMode(QGraphicsView.ScrollHandDrag) |
59 | 59 |
QGraphicsView.mousePressEvent(self.imageViewer, QMouseEvent(QEvent.MouseButtonPress, event.pos(), Qt.LeftButton, event.buttons(), Qt.NoModifier)) |
60 |
elif 'mouseReleaseEvent' == param[0] and event.button() == Qt.MiddleButton:
|
|
60 |
elif 'mouseReleaseEvent' == param[0] and event.button() == Qt.RightButton:
|
|
61 | 61 |
try: |
62 | 62 |
self.imageViewer.setDragMode(QGraphicsView.NoDrag) |
63 | 63 |
finally: |
64 | 64 |
QGraphicsView.mouseReleaseEvent(self.imageViewer, QMouseEvent(QEvent.MouseButtonRelease, event.pos(), Qt.LeftButton, event.buttons(), Qt.NoModifier)) |
65 | 65 |
pass |
66 | 66 |
elif 'mousePressEvent' == param[0] and event.button() == Qt.LeftButton: |
67 |
self.imageViewer.setDragMode(QGraphicsView.RubberBandDrag) |
|
68 |
self.startX = scenePos.x() |
|
69 |
self.startY = scenePos.y() |
|
70 |
self._vertices.clear() |
|
71 |
self._vertices.append(param[2]) |
|
72 |
self.isClicked = True |
|
73 |
elif 'mouseReleaseEvent' == param[0] and event.button() == Qt.LeftButton: |
|
67 |
if not self.imageViewer.scene.items(scenePos): |
|
68 |
self.imageViewer.scene.clearSelection() |
|
69 |
self.imageViewer.setDragMode(QGraphicsView.RubberBandDrag) |
|
70 |
self.startX = scenePos.x() |
|
71 |
self.startY = scenePos.y() |
|
72 |
self._vertices.clear() |
|
73 |
self._vertices.append(param[2]) |
|
74 |
self.isClicked = True |
|
75 |
elif self.isClicked and 'mouseReleaseEvent' == param[0] and event.button() == Qt.LeftButton: |
|
74 | 76 |
try: |
75 | 77 |
QGraphicsView.mouseReleaseEvent(self.imageViewer, event) |
76 | 78 |
self._vertices.append(param[2]) |
... | ... | |
185 | 187 |
self.imageViewer.scene.removeItem(self.symbol) |
186 | 188 |
self.symbol = None |
187 | 189 |
self.isCopy = False |
190 |
pass |
|
188 | 191 |
except Exception as ex: |
189 | 192 |
from App import App |
190 | 193 |
from AppDocData import MessageType |
내보내기 Unified diff