'Update the tab buttons selected style flags.'

def __updateSelected(self):

    if (self.count() == 0):
        return
    opt = QStyleOptionToolBox
    def update(button, next_sel, prev_sel):
        if next_sel:
            button.selected |= opt.NextIsSelected
        else:
            button.selected &= (~ opt.NextIsSelected)
        if prev_sel:
            button.selected |= opt.PreviousIsSelected
        else:
            button.selected &= (~ opt.PreviousIsSelected)
        button.update()
    if (self.count() == 1):
        update(self.__pages[0].button, False, False)
    elif (self.count() >= 2):
        pages = self.__pages
        for i in range(1, (self.count() - 1)):
            update(pages[i].button, pages[(i + 1)].action.isChecked(), pages[(i - 1)].action.isChecked())
