def remove_tab(self, tab=0):
        """
        Removes the tab by index.
        """

        # pop it from the list
        t = self.tabs.pop(tab)

        # remove it from the gui
        self._widget.removeTab(tab)

        # return it in case someone cares
        return t