개정판 3dd93aee
add insert shortcut
Change-Id: I679b93eec56354b06f63c47b676647ef280c492a
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
3076 | 3076 |
"""restore to default command when user press Escape key""" |
3077 | 3077 |
try: |
3078 | 3078 |
#print('main : ' + str(event.key())) |
3079 |
modifiers = QApplication.keyboardModifiers() |
|
3080 |
|
|
3079 | 3081 |
if event.key() == Qt.Key_Escape: |
3080 | 3082 |
checked = self.checked_action() |
3081 | 3083 |
if checked: |
... | ... | |
3149 | 3151 |
if angle != item.angle: |
3150 | 3152 |
return |
3151 | 3153 |
|
3152 |
modifiers = QApplication.keyboardModifiers() |
|
3153 | 3154 |
enter_or_space = ' ' if modifiers == Qt.ControlModifier else ('\n' if modifiers != Qt.AltModifier else '') |
3154 | 3155 |
x_or_y = 0 if (modifiers == Qt.ControlModifier and angle == 0) or (modifiers != Qt.ControlModifier and angle == 1.57) else 1 |
3155 | 3156 |
|
... | ... | |
3187 | 3188 |
# pop up development toolkit dialog |
3188 | 3189 |
from DevelopmentToolkitDialog import QDevelopmentToolkitDialog |
3189 | 3190 |
|
3190 |
modifiers = QApplication.keyboardModifiers() |
|
3191 | 3191 |
if modifiers == Qt.ControlModifier: |
3192 | 3192 |
dlg = QDevelopmentToolkitDialog(self, self.graphicsView) |
3193 | 3193 |
dlg.show() |
3194 |
elif event.key() == Qt.Key_I: |
|
3194 |
elif event.key() == Qt.Key_I or event.key() == Qt.Key_Q:
|
|
3195 | 3195 |
# insert symbol item that is selected symbol in tree to main window if symbol already selected on main window, replace |
3196 | 3196 |
index = self.symbolTreeWidget.currentIndex() |
3197 | 3197 |
proxy_model = self.symbolTreeWidget.model() |
DTI_PID/DTI_PID/QtImageViewerScene.py | ||
---|---|---|
251 | 251 |
elif event.key() == Qt.Key_Y and event.modifiers() & Qt.ControlModifier: |
252 | 252 |
#self._undo_stack.redo() |
253 | 253 |
pass |
254 |
elif self.selectedItems() and event.key() == Qt.Key_R and not(event.modifiers() & Qt.ControlModifier): |
|
254 |
elif self.selectedItems() and event.key() == Qt.Key_R and not (event.modifiers() & Qt.ControlModifier):
|
|
255 | 255 |
self._undo_stack.push(RotateCommand(self, self.selectedItems())) |
256 |
elif self.selectedItems() and event.key() == Qt.Key_F and not(event.modifiers() & Qt.ControlModifier): |
|
256 |
elif self.selectedItems() and event.key() == Qt.Key_F and not (event.modifiers() & Qt.ControlModifier):
|
|
257 | 257 |
self._undo_stack.push(FlipCommand(self, self.selectedItems())) |
258 | 258 |
|
259 | 259 |
super(QtImageViewerScene, self).keyPressEvent(event) |
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py | ||
---|---|---|
1125 | 1125 |
self.loc[0] = self.loc[0] + delta |
1126 | 1126 |
#self.origin[0] = self.origin[0] + delta |
1127 | 1127 |
self.moveBy(delta, 0) |
1128 |
elif event.key() == Qt.Key_I or event.key() == Qt.Key_X or event.key() == Qt.Key_J: |
|
1128 |
elif event.key() == Qt.Key_I or event.key() == Qt.Key_X or event.key() == Qt.Key_J or event.key() == Qt.Key_Q:
|
|
1129 | 1129 |
from App import App |
1130 | 1130 |
App.mainWnd().keyPressEvent(event) |
1131 | 1131 |
|
내보내기 Unified diff