本文整理汇总了Python中PyQt5.QtCore.Qt.Key_E方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.Key_E方法的具体用法?Python Qt.Key_E怎么用?Python Qt.Key_E使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.Key_E方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_E [as 别名]
def __init__(self):
super().__init__()
self._shortcut_key = Qt.Key_E
self._controller = self.getController()
self._selection_pass = None
CuraApplication.getInstance().globalContainerStackChanged.connect(self._updateEnabled)
# Note: if the selection is cleared with this tool active, there is no way to switch to
# another tool than to reselect an object (by clicking it) because the tool buttons in the
# toolbar will have been disabled. That is why we need to ignore the first press event
# after the selection has been cleared.
Selection.selectionChanged.connect(self._onSelectionChanged)
self._had_selection = False
self._skip_press = False
self._had_selection_timer = QTimer()
self._had_selection_timer.setInterval(0)
self._had_selection_timer.setSingleShot(True)
self._had_selection_timer.timeout.connect(self._selectionChangeDelay)
示例2: keyPressEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_E [as 别名]
def keyPressEvent(self, event):
# go the previous block
if event.key() == Qt.Key_BracketLeft:
self.ui.spinBox_skelBlock.setValue(self.skel_block_n - 1)
# go to the next block
elif event.key() == Qt.Key_BracketRight:
self.ui.spinBox_skelBlock.setValue(self.skel_block_n + 1)
elif event.key() == Qt.Key_Semicolon:
if self.ui.checkBox_showLabel.isChecked():
self.ui.checkBox_showLabel.setChecked(0)
else:
self.ui.checkBox_showLabel.setChecked(1)
elif event.key() == Qt.Key_E:
self.egg_writer.add(self.vfilename, self.frame_number)
elif event.key() == Qt.Key_X:
self.egg_writer.tag_bad()
super().keyPressEvent(event)
示例3: eventFilter
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_E [as 别名]
def eventFilter(self, obj, e):
if obj == self.command and e.type() == QEvent.KeyPress:
history = self.device.history
if e.modifiers() & Qt.ControlModifier:
if e.key() == Qt.Key_H:
d = DeviceConsoleHistory(self.device.env.devices)
if d.exec_() == QDialog.Accepted:
self.command.setText(d.command)
elif len(history) > 0:
if e.key() == Qt.Key_E:
self.command.setText(history[0])
if e.key() == Qt.Key_Down:
self.command.completer().setModel(QStringListModel(history))
self.command.setText(' ')
self.command.completer().complete()
return False
return QDockWidget.eventFilter(self, obj, e)
示例4: test_init
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_E [as 别名]
def test_init(self):
seq = keyutils.KeySequence(Qt.Key_A, Qt.Key_B, Qt.Key_C, Qt.Key_D,
Qt.Key_E)
assert len(seq._sequences) == 2
assert len(seq._sequences[0]) == 4
assert len(seq._sequences[1]) == 1
示例5: test_iter
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_E [as 别名]
def test_iter(self):
seq = keyutils.KeySequence(Qt.Key_A | Qt.ControlModifier,
Qt.Key_B | Qt.ShiftModifier,
Qt.Key_C,
Qt.Key_D,
Qt.Key_E)
expected = [keyutils.KeyInfo(Qt.Key_A, Qt.ControlModifier),
keyutils.KeyInfo(Qt.Key_B, Qt.ShiftModifier),
keyutils.KeyInfo(Qt.Key_C, Qt.NoModifier),
keyutils.KeyInfo(Qt.Key_D, Qt.NoModifier),
keyutils.KeyInfo(Qt.Key_E, Qt.NoModifier)]
assert list(seq) == expected