no need to reconstruct PyQt6 enums
PyQt6 can serialize / deserialize enums and flags w/o us manually casting them to int. In PyQt6 6.0, it was okay to pass the already deserialized flag back to the class constructor. In PyQt6 6.1, the flags MouseButtons and KeyboardModifiers have been renamed to MouseButton and KeyboardModifier respectively. skipping the reconstruction allows it to work on both PyQt6 6.0 and 6.1. note that this was already done in deserialize_mouse_event()
This commit is contained in:
parent
64702981d4
commit
2aed5c36d5
@ -259,6 +259,7 @@ class Renderer(GraphicsView):
|
|||||||
|
|
||||||
def deserialize_wheel_event(self, wheel_event):
|
def deserialize_wheel_event(self, wheel_event):
|
||||||
pos, gpos, pixelDelta, angleDelta, btns, mods, phase, inverted = wheel_event
|
pos, gpos, pixelDelta, angleDelta, btns, mods, phase, inverted = wheel_event
|
||||||
|
if QT_LIB != 'PyQt6':
|
||||||
btns = QtCore.Qt.MouseButtons(btns)
|
btns = QtCore.Qt.MouseButtons(btns)
|
||||||
mods = QtCore.Qt.KeyboardModifiers(mods)
|
mods = QtCore.Qt.KeyboardModifiers(mods)
|
||||||
phase = QtCore.Qt.ScrollPhase(phase)
|
phase = QtCore.Qt.ScrollPhase(phase)
|
||||||
|
Loading…
Reference in New Issue
Block a user