PDA

View Full Version : QUndoCommand with QFileSystemModel



NIteLordz
16th September 2016, 17:52
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.

anda_skoa
17th September 2016, 10:09
Since you haven't posted any code my guess is that changing the child directory in the tree view changes the base directory of the list view and your might have forgotten to clear the undo stack, so redo executes a selection change that was for a different model content.

Cheers,
_