File: undo_command.cpp

package info (click to toggle)
antimony 0.9.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 6,472 kB
  • sloc: cpp: 42,596; ansic: 28,661; python: 1,093; yacc: 128; lex: 114; sh: 90; makefile: 10
file content (18 lines) | stat: -rw-r--r-- 383 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "undo/undo_command.h"

UndoCommand::UndoCommand(QUndoCommand* parent)
    : QUndoCommand(parent), stack(NULL)
{
    // Nothing to do here
}

void UndoCommand::setStack(UndoStack* s, const QUndoCommand* cmd)
{
    if (auto u = dynamic_cast<const UndoCommand*>(cmd))
        u->stack = s;

    for (int i=0; i < cmd->childCount(); ++i)
        setStack(s, cmd->child(i));
}