'Insert category item at index.'

def __insertItem(self, item, index):

    grid = WidgetToolGrid()
    grid.setModel(item.model(), item.index())
    grid.actionTriggered.connect(self.triggered)
    grid.actionHovered.connect(self.hovered)
    grid.setIconSize(self.__iconSize)
    grid.setButtonSize(self.__buttonSize)
    text = item.text()
    icon = item.icon()
    tooltip = item.toolTip()
    grid.setProperty('tab-title', text)
    grid.setObjectName('widgets-toolbox-grid')
    self.insertItem(index, grid, text, icon, tooltip)
    button = self.tabButton(index)
    if (item.data(Qt.BackgroundRole) is not None):
        brush = item.background()
    elif (item.data(QtWidgetRegistry.BACKGROUND_ROLE) is not None):
        brush = item.data(QtWidgetRegistry.BACKGROUND_ROLE)
    else:
        brush = self.palette().brush(QPalette.Button)
    if (not brush.gradient()):
        gradient = create_gradient(brush.color())
        brush = QBrush(gradient)
    palette = button.palette()
    palette.setBrush(QPalette.Highlight, brush)
    button.setPalette(palette)
