thanks tbscope for you answer,

Actually , I dont want to delete items that belongs to a particular window.
When undoing, it should do normal undo operation ,and it doesnt matter whether its same window or not.(Because my application uses MVC pattern,where I have one Data and multiple Views).
Only problem is when I close any of the QMainWindow , my QUndoStack also get cleared.
May be during onClose() method of QMainWindow, QT clears any QUndoStack attached to that.
If you can just override this method,then I think I can solve the problem.



Quote Originally Posted by tbscope View Post
I guess you need to write something of your own.

How would the stack delete only those items that belong to one window?
And if it does know how to do that, what sense does this make? Doesn't this mean that the whole undo/redo history is corrupted anyway?