Пример #1
0
 def create_tabwidget(self):
     """Create a new QTabWidget with a button to add new tabs"""
     tabs = QTabWidget(self)
     tabs.setMovable(True)
     tabs.setTabsClosable(True)
     # create a button to add new tabs
     plus_btn = QToolButton(tabs)
     plus_btn.setText('+')
     plus_btn.clicked.connect(self.plus_button_clicked)
     tabs.setCornerWidget(plus_btn, Qt.TopLeftCorner)
     tabs.tabCloseRequested.connect(self.close_tab)
     return tabs
Пример #2
0
 def create_tabwidget(self):
     """Create a new QTabWidget with a button to add new tabs"""
     tabs = QTabWidget(self)
     tabs.setMovable(True)
     tabs.setTabsClosable(True)
     # create a button to add new tabs
     plus_btn = QToolButton(tabs)
     plus_btn.setText('+')
     plus_btn.clicked.connect(self.plus_button_clicked)
     tabs.setCornerWidget(plus_btn, Qt.TopLeftCorner)
     tabs.tabCloseRequested.connect(self.close_tab)
     return tabs