QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
removediagramcommand.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef REMOVEDIAGRAMCOMMAND_H
19#define REMOVEDIAGRAMCOMMAND_H
20
21#include <QUndoCommand>
22#include <QPointer>
23
24class QETProject;
25class Diagram;
26
36class RemoveDiagramCommand : public QUndoCommand
37{
38 public:
39 RemoveDiagramCommand(QETProject *project, Diagram *diagram, QUndoCommand *parent = nullptr);
40 ~RemoveDiagramCommand() override;
41
42 void undo() override;
43 void redo() override;
44
45 private:
46 QPointer<QETProject> m_project;
50 bool m_owns_diagram = false;
51};
52
53#endif // REMOVEDIAGRAMCOMMAND_H
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:54
Definition qetproject.h:77
void undo() override
Definition removediagramcommand.cpp:60
RemoveDiagramCommand(QETProject *project, Diagram *diagram, QUndoCommand *parent=nullptr)
RemoveDiagramCommand::RemoveDiagramCommand.
Definition removediagramcommand.cpp:29
void redo() override
Definition removediagramcommand.cpp:51
QPointer< QETProject > m_project
Definition removediagramcommand.h:46
~RemoveDiagramCommand() override
RemoveDiagramCommand::~RemoveDiagramCommand Destroy the diagram only if it is currently detached from...
Definition removediagramcommand.cpp:44
int m_position
Definition removediagramcommand.h:48
bool m_owns_diagram
true while the diagram is detached from the project (i.e. the removal is in effect)
Definition removediagramcommand.h:50
Diagram * m_diagram
Definition removediagramcommand.h:47