In pyqt5, in tree_widget.py the following code worked without any kind of wrapping:
def save_sort(column, qt_sort_order):
storage = weakStorage()
if storage:
storage.put(self.storage_key, [column, qt_sort_order])
self.tree_view.header().sortIndicatorChanged.connect(save_sort)In pyqt6, the enum Qt::SortOrder managed by the sortIndicatorChanged signal is now a python Enum, which JSON seems unable to process.
TypeError: Object of type SortOrder is not JSON serializable
Handle this issue via the JSONEncoder.