code: def add_tab(self, widget, name, filename=''):
          
          self.clients.append(widget)
          index = self.tabwidget.addTab(widget, name)
          self.filenames.insert(index, filename)
          self.tabwidget.setCurrentIndex(index)
          if self.dockwidget and not self.main.is_setting_up:
              self.switch_to_plugin()
          self.activateWindow()
          widget.get_control().setFocus()
          self.update_tabs_text()
docs: Add tab