def insertTab(self, index, tab):
        """
        Adds a new tab to this panel bar.

        :param      tab | <XViewPanelItem> || <str>

        :return     <int>
        """
        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
Adds a new tab to this panel bar.

        :param      tab | <XViewPanelItem> || <str>

        :return     <int>