After working with Qt5/6 for a while, I can start to understand the gravitation towards Electron cancer over native toolkits. I've been struggling to ensure the same elements are selected after changing the sort order on a QListView that uses my own QAbstractListModel.
I posted a question on Stackoverflow, and got a comment asking for a minimal example. It's a pretty complex widget, and when I trimmed down a minimal example, the question got a down vote.
I've also posted the question on the official QT forums, to get more visibility from actual QT developers.
Maybe someone on fedi who's familiar with Qt would want to take a stab at it.