code: def insertTab(self, index, tab):
          
          if not isinstance(tab, XViewPanelItem):
              tab = XViewPanelItem(tab, self)
              tab.setFixedHeight(self.height())
  
          # remove it from the layout first
          self.layout().insertWidget(index, tab)
          self.setCurrentIndex(index)
          return tab
docs: Adds a new tab to this panel bar.
  
          :param      tab | <XViewPanelItem> || <str>
  
          :return     <int>