

def setTabCloseButtonVisible(self, index, visible, refresh=True):
    " Set whether the close button for the given tab is visible.\n\n        The 'tabsClosable' property must be set to True for this to\n        have effect.\n\n        Parameters\n        ----------\n        index : int\n            The index of the target page.\n\n        visible : bool\n            Whether or not the close button for the tab should be\n            visible.\n\n        refresh : bool, optional\n            Whether or not to refresh the tab bar at the end of the\n            operation. The default is True.\n\n        "
    if ((index >= 0) and (index < self.count())):
        tabBar = self.tabBar()
        btn1 = tabBar.tabButton(index, QTabBar.LeftSide)
        btn2 = tabBar.tabButton(index, QTabBar.RightSide)
        if (btn1 is not None):
            btn1.setVisible(visible)
            if (not visible):
                btn1.resize(0, 0)
            else:
                btn1.resize(btn1.sizeHint())
        if (btn2 is not None):
            btn2.setVisible(visible)
            if (not visible):
                btn2.resize(0, 0)
            else:
                btn1.resize(btn2.sizeHint())
        if refresh:
            self._refreshTabBar()

dataset/ETHPy150Open ContinuumIO/ashiba/enaml/enaml/qt/qt_notebook.py QNotebook.setTabCloseButtonVisible/VarMisuse@166/391 `btn2`->`btn1`