Maki
Formally verified low-code orchestration
Loading...
Searching...
No Matches
add_node.h
1#pragma once
2
3#include <QUndoCommand>
4
5#include "../canvas.h"
6#include "save_info.h"
7
8class QPointF;
9
13class AddNodeCommand : public QUndoCommand
14{
15public:
23 AddNodeCommand(Canvas* canvas, const NodeSaveInfo& desc, Canvas::NodeCreation creation, QUndoCommand* parent = nullptr);
24
28 void undo() override;
29
33 void redo() override;
34
35private:
36 Canvas* mCanvas = nullptr;
38 const Canvas::NodeCreation mCreation;
39};
void undo() override
Undoes the addition of a node from the canvas.
Definition add_node.cpp:15
const Canvas::NodeCreation mCreation
Description of the node to be added.
Definition add_node.h:38
const NodeSaveInfo mDesc
Pointer to the Canvas where the node will be added.
Definition add_node.h:37
AddNodeCommand(Canvas *canvas, const NodeSaveInfo &desc, Canvas::NodeCreation creation, QUndoCommand *parent=nullptr)
Constructs an AddNodeCommand object.
Definition add_node.cpp:6
void redo() override
Redoes the addition of a node to the canvas.
Definition add_node.cpp:24
The Canvas class represents the main drawing area for nodes and transitions.
Definition canvas.h:35
Represents a node that can be saved and loaded.
Definition node_info.h:16