'Create the tab button for `widget`.'

def createTabButton(self, widget, text, icon=None, toolTip=None):

    action = QAction(text, self)
    action.setCheckable(True)
    if icon:
        action.setIcon(icon)
    if toolTip:
        action.setToolTip(toolTip)
    self.__tabActionGroup.addAction(action)
    self.__actionMapper.setMapping(action, action)
    action.toggled.connect(self.__actionMapper.map)
    button = ToolBoxTabButton(self, objectName='toolbox-tab-button')
    button.setDefaultAction(action)
    button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
    button.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
    if self.__tabIconSize.isValid():
        button.setIconSize(self.__tabIconSize)
    if (self.__tabButtonHeight > 0):
        button.setFixedHeight(self.__tabButtonHeight)
    return button
