shared QUnstackStack among several QMainWindows ?
Greetings all,
In my application,user can open several QWindows which share the same data.I needed to use one shared QUndoStack between the windows.
Undo/Redo works fine,but when any of a QWindow closed, Undo/Redo menu get disabled.I guess its because the stack get cleared.
Any tips? Thanks
Here is a snapshot of my application - http://oi53.tinypic.com/2rfbztg.jpg
Re: shared QUnstackStack among several QMainWindows ?
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?
Re: shared QUnstackStack among several QMainWindows ?
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
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?