code: def get_plugin_tabwidget(self, plugin):
          
          # The tab widget is named "tabs" in the editor plugin while it is
          # named "tabwidget" in the notebook plugin.
          try:
              tabwidget = plugin.get_current_tab_manager().tabs
          except AttributeError:
              tabwidget = plugin.get_current_tab_manager().tabwidget
  
          return tabwidget
docs: Get the tabwidget of the plugin's current tab manager.