当前位置: 首页>>代码示例>>Python>>正文


Python QEvent.Wheel方法代码示例

本文整理汇总了Python中PyQt5.QtCore.QEvent.Wheel方法的典型用法代码示例。如果您正苦于以下问题:Python QEvent.Wheel方法的具体用法?Python QEvent.Wheel怎么用?Python QEvent.Wheel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtCore.QEvent的用法示例。


在下文中一共展示了QEvent.Wheel方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: handleEvent

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import Wheel [as 别名]
def handleEvent(self, event):
        if event.type() == QEvent.MouseButtonPress:
            ex, ey = self._normalizeCoordinates(event.windowPos().x(), event.windowPos().y())
            e = MouseEvent(MouseEvent.MousePressEvent, ex, ey, self._x, self._y, self._qtButtonsToButtonList(event.buttons()))
            self._x = ex
            self._y = ey
            self.event.emit(e)
        elif event.type() == QEvent.MouseMove:
            ex, ey = self._normalizeCoordinates(event.windowPos().x(), event.windowPos().y())
            e = MouseEvent(MouseEvent.MouseMoveEvent, ex, ey, self._x, self._y, self._qtButtonsToButtonList(event.buttons()))
            self._x = ex
            self._y = ey
            self.event.emit(e)
        elif event.type() == QEvent.MouseButtonRelease:
            ex, ey = self._normalizeCoordinates(event.windowPos().x(), event.windowPos().y())
            e = MouseEvent(MouseEvent.MouseReleaseEvent, ex, ey, self._x, self._y, self._qtButtonsToButtonList(event.button()))
            self._x = ex
            self._y = ey
            self.event.emit(e)
        elif event.type() == QEvent.Wheel:
            delta = event.angleDelta()
            e = WheelEvent(delta.x(), delta.y())
            self.event.emit(e) 
开发者ID:Ultimaker,项目名称:Uranium,代码行数:25,代码来源:QtMouseDevice.py

示例2: __init__

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import Wheel [as 别名]
def __init__(self, tab, *, parent=None):
        super().__init__(parent)
        self._tab = tab
        self._handlers = {
            QEvent.MouseButtonPress: self._handle_mouse_press,
            QEvent.MouseButtonRelease: self._handle_mouse_release,
            QEvent.Wheel: self._handle_wheel,
            QEvent.KeyRelease: self._handle_key_release,
        }
        self._ignore_wheel_event = False
        self._check_insertmode_on_release = False 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:13,代码来源:eventfilter.py

示例3: eventFilter

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import Wheel [as 别名]
def eventFilter(self, obj, event):
        if event.type() == QEvent.Wheel and 'SpinBox' in str(obj):
            return True

        return False 
开发者ID:canard0328,项目名称:malss,代码行数:7,代码来源:results_base.py

示例4: eventFilter

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import Wheel [as 别名]
def eventFilter(self, source, evt):
    t = evt.type()
    if t == QEvent.Wheel:
      self.new_entry_flag = True
      self.mouse_scroll_event(evt)
      return True
    elif t == QEvent.KeyPress:
      self.new_entry_flag = True
      if evt.key() == QtCore.Qt.Key_Return:
        self.update_entry(evt)
        return True
    return False 
开发者ID:lutusp,项目名称:PLSDR,代码行数:14,代码来源:MyTextEntry.py

示例5: eventFilter

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import Wheel [as 别名]
def eventFilter(self, source, evt):
    t = evt.type()
    if t == QEvent.Wheel:
      self.mouse_scroll_event(evt)
      return True
    elif t == QEvent.ContextMenu:
      self.parent.erase_digits_to_right(self)
      self.reset_color()
      return True
    return False 
开发者ID:lutusp,项目名称:PLSDR,代码行数:12,代码来源:FreqDigit.py

示例6: eventFilter

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import Wheel [as 别名]
def eventFilter(self, object, evt):
    if evt.type() == QEvent.Wheel:
      self.bias += (-4,4)[evt.angleDelta().y() > 0]
    return False 
开发者ID:lutusp,项目名称:PLSDR,代码行数:6,代码来源:Waterfall.py

示例7: eventFilter

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import Wheel [as 别名]
def eventFilter(self, source, evt):
    t = evt.type()
    if t == QEvent.Wheel:
      v = (-5,5)[evt.angleDelta().y() > 0]
      pos = self.obj.value() + v
      pos = self.limit_range(pos)
      self.obj.setValue(pos)
      self.config[self.config_name] = pos
      return True
    return False 
开发者ID:lutusp,项目名称:PLSDR,代码行数:12,代码来源:MySlider.py


注:本文中的PyQt5.QtCore.QEvent.Wheel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。