QElectroTech  0.8-dev
rotateselectioncommand.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 ROTATESELECTIONCOMMAND_H
19 #define ROTATESELECTIONCOMMAND_H
20 
21 #include <QUndoCommand>
22 #include <QPointer>
23 
24 class Diagram;
25 class ConductorTextItem;
27 
32 class RotateSelectionCommand : public QUndoCommand
33 {
34  public:
35  RotateSelectionCommand(Diagram *diagram, qreal angle=90, QUndoCommand *parent=nullptr);
36  void undo() override;
37  void redo() override;
38 
39  bool isValid();
40 
41  private:
42  Diagram *m_diagram =nullptr;
43 
44  QList<QPointer<ConductorTextItem>> m_cond_text;
45  QHash<ConductorTextItem *, bool> m_rotate_by_user;
46  QList<QPropertyUndoCommand*> m_undo;
47 
48 };
49 
50 #endif // ROTATESELECTIONCOMMAND_H
RotateSelectionCommand
The RotateSelectionCommand class Rotate the selected items in the given diagram.
Definition: rotateselectioncommand.h:33
RotateSelectionCommand::m_undo
QList< QPropertyUndoCommand * > m_undo
Definition: rotateselectioncommand.h:46
RotateSelectionCommand::redo
void redo() override
RotateSelectionCommand::redo.
Definition: rotateselectioncommand.cpp:101
IndependentTextItem::Type
@ Type
Definition: independenttextitem.h:39
conductor.h
conductortextitem.h
Diagram::showMe
void showMe()
Definition: diagram.h:161
elementtextitemgroup.h
Element::Type
@ Type
Definition: element.h:74
RotateSelectionCommand::isValid
bool isValid()
RotateSelectionCommand::isValid.
Definition: rotateselectioncommand.cpp:117
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
DynamicElementTextItem::Type
@ Type
Definition: dynamicelementtextitem.h:61
qet.h
RotateSelectionCommand::m_cond_text
QList< QPointer< ConductorTextItem > > m_cond_text
Definition: rotateselectioncommand.h:44
RotateSelectionCommand::m_rotate_by_user
QHash< ConductorTextItem *, bool > m_rotate_by_user
Definition: rotateselectioncommand.h:45
rotateselectioncommand.h
Diagram::isReadOnly
bool isReadOnly() const
Diagram::isReadOnly.
Definition: diagram.cpp:2363
RotateSelectionCommand::undo
void undo() override
RotateSelectionCommand::undo.
Definition: rotateselectioncommand.cpp:85
element.h
qpropertyundocommand.h
RotateSelectionCommand::RotateSelectionCommand
RotateSelectionCommand(Diagram *diagram, qreal angle=90, QUndoCommand *parent=nullptr)
Definition: rotateselectioncommand.cpp:32
independenttextitem.h
RotateSelectionCommand::m_diagram
Diagram * m_diagram
Definition: rotateselectioncommand.h:42
ElementTextItemGroup
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
Definition: elementtextitemgroup.h:36
ConductorTextItem::Type
@ Type
Definition: conductortextitem.h:42
dynamicelementtextitem.h
DiagramImageItem::Type
@ Type
Definition: diagramimageitem.h:42
ConductorTextItem
Definition: conductortextitem.h:30
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
diagramimageitem.h
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
diagram.h