QElectroTech  0.8-dev
pastepartscommand.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 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 
24 class 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,
53  m_first_redo = true;
54 };
55 
56 #endif // PASTEPARTSCOMMAND_H
ElementContent
QList< QGraphicsItem * > ElementContent
Definition: elementcontent.h:21
ElementView
Definition: elementview.h:27
pastepartscommand.h
ElementView::start_top_left_corner_
QPointF start_top_left_corner_
Definition: elementview.h:89
PastePartsCommand::m_pasted_content
ElementContent m_pasted_content
Definition: pastepartscommand.h:44
PastePartsCommand::m_old_start_top_left_corner
QPointF m_old_start_top_left_corner
Definition: pastepartscommand.h:49
PastePartsCommand::setOffset
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:110
PastePartsCommand::m_uses_offset
bool m_uses_offset
Definition: pastepartscommand.h:52
PastePartsCommand::PastePartsCommand
PastePartsCommand(const PastePartsCommand &)
ElementView::adjustSceneRect
void adjustSceneRect()
ElementView::adjustSceneRect Adjust the scenRect, so that he include all primitives of element plus t...
Definition: elementview.cpp:151
PastePartsCommand::~PastePartsCommand
~PastePartsCommand() override
PastePartsCommand::~PastePartsCommand.
Definition: pastepartscommand.cpp:52
ElementEditionCommand
The ElementEditionCommand class ElementEditionCommand is the base class for all commands classes invo...
Definition: editorcommands.h:33
PastePartsCommand::m_old_offset_paste_count
int m_old_offset_paste_count
Definition: pastepartscommand.h:46
ElementView::offset_paste_count_
int offset_paste_count_
Definition: elementview.h:88
PastePartsCommand::redo
void redo() override
PastePartsCommand::redo.
Definition: pastepartscommand.cpp:80
partterminal.h
ElementEditionCommand::m_view
ElementView * m_view
Definition: editorcommands.h:58
PastePartsCommand::undo
void undo() override
PastePartsCommand::undo.
Definition: pastepartscommand.cpp:60
PartTerminal
Definition: partterminal.h:30
QGIManager::release
void release(QGraphicsItem *)
Definition: qgimanager.cpp:60
PastePartsCommand::m_new_start_top_left_corner
QPointF m_new_start_top_left_corner
Definition: pastepartscommand.h:50
elementview.h
editorcommands.h
ElementScene::qgiManager
QGIManager & qgiManager()
ElementScene::qgiManager.
Definition: elementscene.cpp:612
ElementScene::slot_select
void slot_select(const ElementContent &)
ElementScene::slot_select Select the item in content, every others items in the scene are deselected.
Definition: elementscene.cpp:706
PastePartsCommand::m_first_redo
bool m_first_redo
Definition: pastepartscommand.h:53
PartTerminal::setNewUuid
void setNewUuid()
Definition: partterminal.cpp:144
PartTerminal::Type
@ Type
Definition: partterminal.h:48
elementcontent.h
ElementEditionCommand::m_scene
ElementScene * m_scene
Element editor/view/scene the command should take place on.
Definition: editorcommands.h:57
QGIManager::manage
void manage(QGraphicsItem *)
Definition: qgimanager.cpp:48
PastePartsCommand::PastePartsCommand
PastePartsCommand(ElementView *view, const ElementContent &content_to_paste, QUndoCommand *parent=nullptr)
PastePartsCommand::PastePartsCommand.
Definition: pastepartscommand.cpp:31
PastePartsCommand::m_new_offset_paste_count
int m_new_offset_paste_count
Definition: pastepartscommand.h:47
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
PastePartsCommand
The PastePartsCommand class Undo command for paste element primitive in an element editor.
Definition: pastepartscommand.h:31