QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
rotatetextscommand.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 ROTATETEXTSCOMMAND_H
19#define ROTATETEXTSCOMMAND_H
20
21#include <QUndoCommand>
22#include <QPointer>
23#include <QHash>
24
26class Diagram;
27class QParallelAnimationGroup;
28
34class RotateTextsCommand : public QUndoCommand
35{
36 public:
37 RotateTextsCommand(Diagram *diagram, QUndoCommand *parent=nullptr);
38
39 void undo() override;
40 void redo() override;
41
42 private:
43 void openDialog();
44 void setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant& start, const QVariant& end);
45
46 private:
47 QPointer<Diagram> m_diagram;
48 QHash<ConductorTextItem *, bool> m_cond_texts;
49 qreal m_rotation=0;
50 QParallelAnimationGroup *m_anim_group = nullptr;
51};
52
53#endif // ROTATETEXTSCOMMAND_H
Definition conductortextitem.h:30
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
The RotateTextsCommand class Open a dialog for edit the rotation of the current selected texts and te...
Definition rotatetextscommand.h:35
void undo() override
Definition rotatetextscommand.cpp:83
void setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant &start, const QVariant &end)
Definition rotatetextscommand.cpp:138
void redo() override
Definition rotatetextscommand.cpp:95
QHash< ConductorTextItem *, bool > m_cond_texts
Definition rotatetextscommand.h:48
QPointer< Diagram > m_diagram
Definition rotatetextscommand.h:47
qreal m_rotation
Definition rotatetextscommand.h:49
void openDialog()
Definition rotatetextscommand.cpp:107
QParallelAnimationGroup * m_anim_group
Definition rotatetextscommand.h:50