Python PyQt5.QtCore.QEvent.Wheel() Examples

The following are 7 code examples of PyQt5.QtCore.QEvent.Wheel(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtCore.QEvent , or try the search function .
Example #1
Source File: QtMouseDevice.py    From Uranium with GNU Lesser General Public License v3.0 6 votes vote down vote up
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) 
Example #2
Source File: eventfilter.py    From qutebrowser with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #3
Source File: results_base.py    From malss with MIT License 5 votes vote down vote up
def eventFilter(self, obj, event):
        if event.type() == QEvent.Wheel and 'SpinBox' in str(obj):
            return True

        return False 
Example #4
Source File: MyTextEntry.py    From PLSDR with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #5
Source File: FreqDigit.py    From PLSDR with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #6
Source File: Waterfall.py    From PLSDR with GNU General Public License v3.0 5 votes vote down vote up
def eventFilter(self, object, evt):
    if evt.type() == QEvent.Wheel:
      self.bias += (-4,4)[evt.angleDelta().y() > 0]
    return False 
Example #7
Source File: MySlider.py    From PLSDR with GNU General Public License v3.0 5 votes vote down vote up
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