code: def move_tab(self, index_from, index_to):
          
          self.move_data.emit(index_from, index_to)
  
          tip, text = self.tabToolTip(index_from), self.tabText(index_from)
          icon, widget = self.tabIcon(index_from), self.widget(index_from)
          current_widget = self.currentWidget()
          
          self.removeTab(index_from)
          self.insertTab(index_to, widget, icon, text)
          self.setTabToolTip(index_to, tip)
          
          self.setCurrentWidget(current_widget)
          self.move_tab_finished.emit()
docs: Move tab inside a tabwidget