code: def add_toolbars_to_menu(self, menu_title, actions):
          
          # Six is the position of the view menu in menus list
          # that you can find in plugins/editor.py setup_other_windows.
          view_menu = self.menus[6]
          if actions == self.toolbars and view_menu:
              toolbars = []
              for toolbar in self.toolbars:
                  action = toolbar.toggleViewAction()
                  toolbars.append(action)
              add_actions(view_menu, toolbars)
docs: Add toolbars to a menu.