개정판 6cc74487
add multiple B
Change-Id: I1186e571a4c10bf07e289cb5dda60db19895f606
DTI_PID/DTI_PID/QtImageViewerScene.py | ||
---|---|---|
93 | 93 |
event.accept() |
94 | 94 |
return |
95 | 95 |
elif event.key() in [Qt.Key_Up, Qt.Key_Down, Qt.Key_Left, Qt.Key_Right, Qt.Key_Return]: |
96 |
|
|
97 |
items = [text for text in self.selectedItems() if |
|
98 |
issubclass(type(text), QEngineeringTextItem) or issubclass(type(text), SymbolSvgItem) or type(text) == QEngineeringLineItem] |
|
99 |
self._pressed_keys.add(event.key()) |
|
100 |
if items: |
|
101 |
for item in items: |
|
102 |
item.keyPressEvent(event) |
|
96 |
items = [text for text in self.selectedItems() if |
|
97 |
issubclass(type(text), QEngineeringTextItem) or issubclass(type(text), SymbolSvgItem) or type(text) == QEngineeringLineItem] |
|
98 |
self._pressed_keys.add(event.key()) |
|
99 |
if items: |
|
100 |
for item in items: |
|
101 |
item.keyPressEvent(event) |
|
102 |
|
|
103 |
modifiers = QApplication.keyboardModifiers() |
|
104 |
delta = 10 if modifiers == Qt.ControlModifier else 1 |
|
105 |
if event.key() == Qt.Key_Up: |
|
106 |
self._delta.setY(self._delta.y() - delta) |
|
107 |
elif event.key() == Qt.Key_Down: |
|
108 |
self._delta.setY(self._delta.y() + delta) |
|
109 |
elif event.key() == Qt.Key_Left: |
|
110 |
self._delta.setX(self._delta.x() - delta) |
|
111 |
elif event.key() == Qt.Key_Right: |
|
112 |
self._delta.setX(self._delta.x() + delta) |
|
113 |
|
|
114 |
event.accept() |
|
115 |
return |
|
116 |
elif event.key() == Qt.Key_B: |
|
117 |
items = [item for item in self.selectedItems() if issubclass(type(item), SymbolSvgItem)] |
|
118 |
if items: |
|
119 |
for item in items: |
|
120 |
item.keyPressEvent(event) |
|
121 |
event.accept() |
|
122 |
return |
|
103 | 123 |
|
104 |
modifiers = QApplication.keyboardModifiers() |
|
105 |
delta = 10 if modifiers == Qt.ControlModifier else 1 |
|
106 |
if event.key() == Qt.Key_Up: |
|
107 |
self._delta.setY(self._delta.y() - delta) |
|
108 |
elif event.key() == Qt.Key_Down: |
|
109 |
self._delta.setY(self._delta.y() + delta) |
|
110 |
elif event.key() == Qt.Key_Left: |
|
111 |
self._delta.setX(self._delta.x() - delta) |
|
112 |
elif event.key() == Qt.Key_Right: |
|
113 |
self._delta.setX(self._delta.x() + delta) |
|
114 |
|
|
115 |
event.accept() |
|
116 |
return |
|
117 | 124 |
elif event.key() == Qt.Key_C and event.modifiers() & Qt.ControlModifier: |
118 | 125 |
from xml.etree import ElementTree |
119 | 126 |
import XmlGenerator as xg |
내보내기 Unified diff