code: def QTabCapsulate(self, name, widget_list, blocking = False):
          
  
          class QuickWindow(QtWidgets.QMainWindow):
  
              class Signals(QtCore.QObject):
                  close = QtCore.Signal()
                  show  = QtCore.Signal()
  
              def __init__(self, blocking = False, parent = None):
                  super().__init__(parent)
                  self.propagate = True # send signals or not
                  self.setStyleSheet(style.main_gui)
                  if (blocking):
                      self.setWindowModality(QtCore.Qt.ApplicationModal)
                  self.signals = self.Signals()
                  self.tab = QtWidgets.QTabWidget()
                  self.setCentralWidget(self.tab)
                  self.setLayout(QtWidgets.QHBoxLayout())
  
              def closeEvent(self, e):
                  if (self.propagate):
                      self.signals.close.emit()
                  e.accept()
                  
              def showEvent(self, e):
                  if (self.propagate):
                      self.signals.show.emit()
                  e.accept()
                  
              def setPropagate(self):
                  self.propagate = True
                  
              def unSetPropagate(self):
                  self.propagate = False
                  
  
          win = QuickWindow(blocking = blocking)
          win.setWindowTitle(name)
          for w in widget_list:
              win.tab.addTab(w[0], w[1])
          
          return win
docs: Helper function that encapsulates QWidget into a QMainWindow
          
          :param widget_list:     List of tuples : [(widget,"name"), (widget,"name"), ..]