def __cloneMouseWheelEvent(self, e: QWheelEvent): pos = e.pos() globalPos = e.globalPos() pixelDelta = e.pixelDelta() angleDelta = e.angleDelta() buttons = e.buttons() modifiers = e.modifiers() phase = e.phase() inverted = e.inverted() clone = QWheelEvent(pos, globalPos, pixelDelta, angleDelta, buttons, modifiers, phase, inverted) clone.ignore() clone.accepted = False return clone
def wheelEvent(self, event: QWheelEvent): """ wheelEvent Parameters ---------- event : QWheelEvent """ delta = event.angleDelta() if delta.y() == 0: event.ignore() return d = delta.y() / abs(delta.y()) if d > 0.0: self.scale_up() else: self.scale_down()
def wheelEvent(self, event: QWheelEvent): """ wheelEvent Parameters ---------- event : QWheelEvent """ if QApplication.keyboardModifiers() == Qt.ControlModifier: delta = event.angleDelta() if delta.y() == 0: event.ignore() return d = delta.y() / abs(delta.y()) if d > 0.0: self.scale_up() else: self.scale_down() else: super().wheelEvent(event)
def wheelEvent(self, event: QtGui.QWheelEvent): event.ignore()