QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
pastepartscommand.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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 PASTEPARTSCOMMAND_H
19#define PASTEPARTSCOMMAND_H
20
21#include "../editorcommands.h"
22#include "../elementcontent.h"
23
24class ElementView;
25
31{
32 public:
33 PastePartsCommand(ElementView *view, const ElementContent &content_to_paste, QUndoCommand *parent = nullptr);
34 ~PastePartsCommand() override;
35 private:
37
38 public:
39 void undo() override;
40 void redo() override;
41 virtual void setOffset(int old_offset_paste_count, const QPointF &old_start_top_left_corner, int new_offset_paste_count, const QPointF &new_start_top_left_corner);
42
43 private:
45
48
51
52 bool m_uses_offset = false,
54};
55
56#endif // PASTEPARTSCOMMAND_H
The ElementEditionCommand class ElementEditionCommand is the base class for all commands classes invo...
Definition editorcommands.h:47
Definition elementview.h:27
The PastePartsCommand class Undo command for paste element primitive in an element editor.
Definition pastepartscommand.h:31
bool m_first_redo
Definition pastepartscommand.h:53
void redo() override
PastePartsCommand::redo.
Definition pastepartscommand.cpp:81
int m_old_offset_paste_count
Definition pastepartscommand.h:46
bool m_uses_offset
Definition pastepartscommand.h:52
QPointF m_old_start_top_left_corner
Definition pastepartscommand.h:49
ElementContent m_pasted_content
Definition pastepartscommand.h:44
int m_new_offset_paste_count
Definition pastepartscommand.h:47
~PastePartsCommand() override
PastePartsCommand::~PastePartsCommand.
Definition pastepartscommand.cpp:53
QPointF m_new_start_top_left_corner
Definition pastepartscommand.h:50
virtual void setOffset(int old_offset_paste_count, const QPointF &old_start_top_left_corner, int new_offset_paste_count, const QPointF &new_start_top_left_corner)
PastePartsCommand::setOffset Describe the offset to use with this undo command.
Definition pastepartscommand.cpp:111
PastePartsCommand(const PastePartsCommand &)
void undo() override
PastePartsCommand::undo.
Definition pastepartscommand.cpp:61
QList< QGraphicsItem * > ElementContent
Definition elementcontent.h:30