當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。