Skip to content

Commit

Permalink
Remove QMenu wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
dalthviz committed Dec 12, 2024
1 parent 4f0fbea commit 3a36157
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions qtpy/QtWidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,25 +213,11 @@ def __getattr__(name):

# Make `addAction` compatible with Qt6 >= 6.4
if PYQT5 or PYSIDE2 or parse(_qt_version) < parse("6.4"):

class _QMenu(QMenu):
old_add_action = QMenu.addAction

def addAction(self, *args):
return add_action(
self,
*args,
old_add_action=_QMenu.old_add_action,
)

_menu_add_action = partialmethod(
add_action,
old_add_action=QMenu.addAction,
)
QMenu.addAction = _menu_add_action
# Despite the previous line!
if QMenu.addAction is not _menu_add_action:
QMenu = _QMenu

class _QToolBar(QToolBar):
old_add_action = QToolBar.addAction
Expand Down

0 comments on commit 3a36157

Please sign in to comment.