I am currently using a QTreeView with a QFileSystemModel, and also a QListView with a second QFileSystemModel. QListView handles QTreeView selectionChanged signal, and updates the QListView appropriately. I want to extend this using a QUndoCommand, so that i can undo/redo selection. I currently have it working, but if i change to a child directory in the QTreeView, when i redo selection in the QListView, it crashes.

Is there any examples of this working ?

if not, i can post code if someone can help.