QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
elementtextsmover.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 ELEMENT_TEXTS_MOVER_H
19#define ELEMENT_TEXTS_MOVER_H
20
21#include <QSet>
22#include <QPointF>
23#include <QHash>
24
25class QGraphicsItem;
26class DiagramTextItem;
27class Diagram;
28class QGraphicsItemGroup;
29class QGraphicsSceneMouseEvent;
30
36{
37 public:
39 private:
41
42 public:
43 bool isReady() const;
44 int beginMovement(Diagram *diagram, QGraphicsItem *driver_item = nullptr);
45 void continueMovement(QGraphicsSceneMouseEvent *event);
46 void endMovement();
47
48 private:
49 QString undoText() const;
50
51 private:
52 bool m_movement_running = false;
53 Diagram *m_diagram = nullptr;
54 QGraphicsItem *m_movement_driver = nullptr;
55 QHash <DiagramTextItem *, QPointF> m_texts_hash;
56 QHash <QGraphicsItemGroup *, QPointF> m_grps_hash;
57 QHash <QGraphicsItem *, QPointF> m_items_hash;
58 int m_text_count = 0,
60};
61#endif
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition diagramtextitem.h:34
Definition elementtextsmover.h:36
Diagram * m_diagram
Definition elementtextsmover.h:53
bool m_movement_running
Definition elementtextsmover.h:52
int m_group_count
Definition elementtextsmover.h:59
QString undoText() const
Definition elementtextsmover.cpp:138
int m_text_count
Definition elementtextsmover.h:58
void endMovement()
ElementTextsMover::endMovement Finish the movement by pushing an undo command to the parent diagram o...
Definition elementtextsmover.cpp:111
ElementTextsMover()
ElementTextsMover::ElementTextsMover.
Definition elementtextsmover.cpp:30
bool isReady() const
ElementTextsMover::isReady.
Definition elementtextsmover.cpp:38
QGraphicsItem * m_movement_driver
Definition elementtextsmover.h:54
void continueMovement(QGraphicsSceneMouseEvent *event)
Definition elementtextsmover.cpp:86
QHash< DiagramTextItem *, QPointF > m_texts_hash
Definition elementtextsmover.h:55
ElementTextsMover(const ElementTextsMover &)
QHash< QGraphicsItemGroup *, QPointF > m_grps_hash
Definition elementtextsmover.h:56
QHash< QGraphicsItem *, QPointF > m_items_hash
Definition elementtextsmover.h:57
int beginMovement(Diagram *diagram, QGraphicsItem *driver_item=nullptr)
ElementTextsMover::beginMovement Begin a movement.
Definition elementtextsmover.cpp:50