Skip to content

Commit bdbda26

Browse files
Add QtCore.Qt.MouseButton.MidButton alias for Qt6
If QtCore.Qt.MidButton works with QtPy and Qt6, then QtCore.Qt.MouseButton.MidButton is expected to work as well.
1 parent 3238de7 commit bdbda26

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

qtpy/QtCore.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787

8888
# Alias for MiddleButton removed in PyQt6 but available in PyQt5, PySide2 and PySide6
8989
Qt.MidButton = Qt.MiddleButton
90+
Qt.MouseButton.MidButton = Qt.MiddleButton
9091

9192
# Add removed definition for `Qt.ItemFlags` as an alias of `Qt.ItemFlag`
9293
# passing as default value 0 in the same way PySide6 6.5+ does.
@@ -142,6 +143,7 @@
142143
) = Qt.BackgroundRole
143144
Qt.TextColorRole = Qt.ItemDataRole.TextColorRole = Qt.ForegroundRole
144145
Qt.MidButton = Qt.MiddleButton
146+
Qt.MouseButton.MidButton = Qt.MiddleButton
145147

146148
# Map DeprecationWarning methods
147149
QCoreApplication.exec_ = lambda *args, **kwargs: possibly_static_exec(

0 commit comments

Comments
 (0)