def METHOD_NAME(self, index):
    width = QTabBar.METHOD_NAME(self, index).height()
    if self.padding < 0:
        width += QTabBar.METHOD_NAME(self, index).width()
    else:
        width += self.padding
    return QSize(width, self.fm.height() + 18)