code: def sortByIndex(self, index):
          self.table_level.horizontalHeader().setSortIndicatorShown(True)
          sort_order = self.table_level.horizontalHeader().sortIndicatorOrder()
          self.table_index.model().sort(index, sort_order)
          self._sort_update()