Showing the changes to libraries/script-engine/src/UndoStackScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -42,8 +42,12 @@ void ScriptUndoCommand::undo() { · 41 unmodified lines | |||
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | void ScriptUndoCommand::redo() { | 44 | void ScriptUndoCommand::redo() { |
| 45 | // QUndoStack will call `redo()` when adding a command to the stack. This | ||
| 46 | // makes it difficult to work with commands that span a period of time - for instance, | ||
| 47 | // the entity duplicate + move command that duplicates an entity and then moves it. | ||
| 48 | // A better implementation might be to properly implement `mergeWith()` and `id()` | ||
| 49 | // so that the two actions in the example would be merged. | ||
| 45 | if (_hasRedone) { | 50 | if (_hasRedone) { |
| 46 | qDebug() << "Doing redo!"; | ||
| 47 | QMetaObject::invokeMethod(this, "doRedo"); | 51 | QMetaObject::invokeMethod(this, "doRedo"); |
| 48 | } | 52 | } |
| 49 | _hasRedone = true; | 53 | _hasRedone = true; |