* \brief Execute the given command, pushing it on the undoStack() if available. */
| 1015 | * \brief Execute the given command, pushing it on the undoStack() if available. |
| 1016 | */ |
| 1017 | void AbstractAspect::exec(QUndoCommand* cmd) { |
| 1018 | Q_CHECK_PTR(cmd); |
| 1019 | if (d->m_undoAware && (project() && project()->isUndoAware())) { |
| 1020 | auto* stack = undoStack(); |
| 1021 | if (stack) |
| 1022 | stack->push(cmd); |
| 1023 | else { |
| 1024 | cmd->redo(); |
| 1025 | delete cmd; |
| 1026 | } |
| 1027 | |
| 1028 | if (project()) |
| 1029 | setProjectChanged(true); |
| 1030 | } else { |
| 1031 | cmd->redo(); |
| 1032 | delete cmd; |
| 1033 | } |
| 1034 | } |
| 1035 | |
| 1036 | /** |
| 1037 | * \brief Execute command and arrange for signals to be sent before/after it is redone or undone. |
no test coverage detected