code: def show_shortcuts(self, menu):
          
          for element in getattr(self, menu + '_menu_actions'):
              if element and isinstance(element, QAction):
                  if element._shown_shortcut is not None:
                      element.setShortcut(element._shown_shortcut)
docs: Show action shortcuts in menu