def _new_tab(self): """Spawn a new tab page""" layout = QGridLayout() layout.setSpacing(1) layout.setContentsMargins(0, 0, 0, 0) widget = QMdiArea() widget.setLayout(layout) tab = self.tab_bar tab.addTab(widget, str(tab.count()+1)) tab.setCurrentWidget(widget)