Derf
3rd November 2006, 14:36
Hello
I use Qt 4.2.0 on a mac.
Does a QTextEdit::setDocument() destroy the document's undo stack ?
I am trying to implement undo/redo (with a QUndoStack) for an outliner-like application.
The user can select a row in a tree view, and an associated document appears in a text edit. I use setDocument to switch between documents.
The undo/redo works for the current document's changes, but after a document switch the text edit says no undo avaiable. Hence my question.
--
A related question : Is there a way to set the textEdit or documents undoStack to my undoStack ? I wanted to make undo macros with some textEdit manipulations and had to create my undo commands, only to do something like textEdit->undo() in it. Seems strange. What did I fail to understand ?
--
Third question : when the textEdit has the focus, a shortcut-triggered undo does an undo in the textEdit, but not in my stack which lies in the mainWindow. Do I have to make a filter to catch the undo event in my mainWindow, or is there a way to tell a textEdit something like "forget the undo and redo shortcuts" ?
Thanks in advance for your answers.
Derf
I use Qt 4.2.0 on a mac.
Does a QTextEdit::setDocument() destroy the document's undo stack ?
I am trying to implement undo/redo (with a QUndoStack) for an outliner-like application.
The user can select a row in a tree view, and an associated document appears in a text edit. I use setDocument to switch between documents.
The undo/redo works for the current document's changes, but after a document switch the text edit says no undo avaiable. Hence my question.
--
A related question : Is there a way to set the textEdit or documents undoStack to my undoStack ? I wanted to make undo macros with some textEdit manipulations and had to create my undo commands, only to do something like textEdit->undo() in it. Seems strange. What did I fail to understand ?
--
Third question : when the textEdit has the focus, a shortcut-triggered undo does an undo in the textEdit, but not in my stack which lies in the mainWindow. Do I have to make a filter to catch the undo event in my mainWindow, or is there a way to tell a textEdit something like "forget the undo and redo shortcuts" ?
Thanks in advance for your answers.
Derf