Skip to content

Commit cfcf1b7

Browse files
committed
Fix QtCore.QC.Midbutton Qt6 compat. issue
1 parent d12d9fb commit cfcf1b7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

plotpy/events.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def buttons_to_str(buttons: int) -> str:
109109
string = ""
110110
if buttons & QC.Qt.LeftButton:
111111
string += "L"
112-
if buttons & QC.Qt.MidButton:
112+
if buttons & QC.Qt.MidButton: # Do not use QC.Qt.MouseButton.MidButton (Qt6!)
113113
string += "M"
114114
if buttons & QC.Qt.RightButton:
115115
string += "R"
@@ -1450,8 +1450,9 @@ def stop_moving_action(self, filter, event):
14501450
def setup_standard_tool_filter(filter: StatefulEventFilter, start_state):
14511451
"""Création des filtres standard (pan/zoom) sur boutons milieu/droit"""
14521452
# Bouton du milieu
1453-
PanHandler(filter, QC.Qt.MouseButton.MidButton, start_state=start_state)
1454-
AutoZoomHandler(filter, QC.Qt.MouseButton.MidButton, start_state=start_state)
1453+
# Do not use QC.Qt.MouseButton.MidButton (Qt6!)
1454+
PanHandler(filter, QC.Qt.MidButton, start_state=start_state)
1455+
AutoZoomHandler(filter, QC.Qt.MidButton, start_state=start_state)
14551456

14561457
# Bouton droit
14571458
ZoomHandler(filter, QC.Qt.MouseButton.RightButton, start_state=start_state)

0 commit comments

Comments
 (0)