本文整理汇总了Python中PyQt5.QtCore.Qt.Key_Plus方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.Key_Plus方法的具体用法?Python Qt.Key_Plus怎么用?Python Qt.Key_Plus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.Key_Plus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: keyPressEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Plus [as 别名]
def keyPressEvent(self, event):
#HOT KEYS
if self.video_reader is None:
# break no file open, nothing to do here
return
key = event.key()
if key == Qt.Key_Minus:
self.mainImage.zoom(-1)
elif key == Qt.Key_Plus:
self.mainImage.zoom(1)
super().keyPressEvent(event)
# frame spin box
示例2: left
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Plus [as 别名]
def left(self):
self.widget.switch_page(right=False)
#def keyPressEvent(self, event):
#这里event.key()显示的是按键的编码
#print("按下:" + str(event.key()))
# 举例,这里Qt.Key_A注意虽然字母大写,但按键事件对大小写不敏感
#if (event.key() == Qt.Key_Left):
# self.widget.switch_page(right=False)
#elif (event.key() == Qt.Key_Right):
# self.widget.switch_page(right=True)
#elif (event.modifiers() == Qt.CTRL and event.key() == Qt.Key_Plus):
# self.widget.zoom_book(plus=True)
#elif (event.modifiers() == Qt.CTRL and event.key() == Qt.Key_Minus):
# self.widget.zoom_book(plus=False)
示例3: _qtKeyToUMKey
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Plus [as 别名]
def _qtKeyToUMKey(self, key):
if key == Qt.Key_Shift:
return KeyEvent.ShiftKey
elif key == Qt.Key_Control:
return KeyEvent.ControlKey
elif key == Qt.Key_Alt:
return KeyEvent.AltKey
elif key == Qt.Key_Space:
return KeyEvent.SpaceKey
elif key == Qt.Key_Meta:
return KeyEvent.MetaKey
elif key == Qt.Key_Enter or key == Qt.Key_Return:
return KeyEvent.EnterKey
elif key == Qt.Key_Up:
return KeyEvent.UpKey
elif key == Qt.Key_Down:
return KeyEvent.DownKey
elif key == Qt.Key_Left:
return KeyEvent.LeftKey
elif key == Qt.Key_Right:
return KeyEvent.RightKey
elif key == Qt.Key_Minus:
return KeyEvent.MinusKey
elif key == Qt.Key_Underscore:
return KeyEvent.UnderscoreKey
elif key == Qt.Key_Plus:
return KeyEvent.PlusKey
elif key == Qt.Key_Equal:
return KeyEvent.EqualKey
return key
示例4: keyPressEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Plus [as 别名]
def keyPressEvent(self, event):
if self.vid is not None:
# break no file open, nothing to do here
return
key = event.key()
if key == Qt.Key_Minus:
self.twoViews.zoom(-1)
elif key == Qt.Key_Plus:
self.twoViews.zoom(1)
else:
QMainWindow.keyPressEvent(self, event)
示例5: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Key_Plus [as 别名]
def __init__(self, filename=None, parent=None):
super(SpectraViewer, self).__init__(parent)
self.ui = Ui_SpectraViewer()
self.ui.setupUi(self)
self.sf = 7200
self.k0 = 0
self.dsf = 0
self.dk0 = 0
self.ita = None
self.fig = self.ui.mpl.canvas.fig
self.canvas = self.ui.mpl.canvas
self.ax = self.fig.add_subplot(111)
self.nextMass = QShortcut(Qt.Key_Plus, self)
self.prevMass = QShortcut(Qt.Key_Minus, self)
self.nextMass.activated.connect(self.next_mass)
self.prevMass.activated.connect(self.prev_mass)
self.ui.pushButton_2.clicked.connect(self.toggleMassCal)
self.ui.pushButton.clicked.connect(self.removeMassCalItem)
self.ui.show_mass.clicked.connect(self.yAxisScaleChanged)
self.canvas.mpl_connect('motion_notify_event', self.on_motion)
self.canvas.mpl_connect('button_press_event', self.onMousePress)
self.canvas.mpl_connect('button_release_event', self.onMouseRelease)
self.canvas.mpl_connect("scroll_event", self.scrolling)
self.labels = []
self.action = None
self.lab_lines = []
self.MassCal = []
self.open(filename)