This commit is contained in:
Kovid Goyal 2024-02-19 18:33:11 +05:30
parent 60bc1b2b68
commit 12e2b392ea
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -125,7 +125,7 @@ class AllGUIActions(InterfaceAction):
menu_text = f'{display_name}{shortcuts}'
icon = name_data[display_name]['icon']
if act.popup_type == QToolButton.ToolButtonPopupMode.MenuButtonPopup:
if act.action_add_menu or act.qaction.menu() and act.qaction.menu().children():
if getattr(act, 'action_add_menu', None) or (getattr(act, 'qaction', None) and act.qaction.menu() and act.qaction.menu().children()):
# The action offers both a 'click' and a menu. Use the menu.
menu.addAction(icon, menu_text, partial(self._do_menu, display_name, act))
else: