'Remove a tab at `index`.'

def removeTab(self, index):

    if ((index >= 0) and (index < self.count())):
        self.layout().takeItem(index)
        tab = self.__tabs.pop(index)
        self.__group.removeButton(tab.button)
        tab.button.removeEventFilter(self)
        if (tab.button is self.__sloppyButton):
            self.__sloppyButton = None
            self.__sloppyRegion = QRegion()
        tab.button.deleteLater()
        if (self.currentIndex() == index):
            if self.count():
                self.setCurrentIndex(max((index - 1), 0))
            else:
                self.setCurrentIndex((-1))
