QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
elementsmover.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 ELEMENTS_MOVER_H
19#define ELEMENTS_MOVER_H
20
21#include <QPointF>
22#include <QPointer>
23#include "diagramcontent.h"
24
26class Diagram;
27class QStatusBar;
28
42 // constructors, destructor
43 public:
45 virtual ~ElementsMover();
46 private:
48
49 // methods
50 public:
51 bool isReady() const;
52 int beginMovement(Diagram *, QGraphicsItem * = nullptr);
53 void continueMovement(const QPointF &);
54 void endMovement();
55
56 // attributes
57 private:
58 bool m_movement_running{false};
60 Diagram *m_diagram{nullptr};
61 QGraphicsItem *m_movement_driver{nullptr};
63 QPointer<QStatusBar> m_status_bar;
64
65};
66#endif
Definition conductortextitem.h:30
Definition diagramcontent.h:47
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition elementsmover.h:41
QPointF m_current_movement
Definition elementsmover.h:59
ElementsMover()
ElementsMover::ElementsMover Constructor.
Definition elementsmover.cpp:37
int beginMovement(Diagram *, QGraphicsItem *=nullptr)
ElementsMover::beginMovement Start a new movement.
Definition elementsmover.cpp:61
bool isReady() const
ElementsMover::isReady.
Definition elementsmover.cpp:49
void endMovement()
ElementsMover::endMovement Ended the current movement by creating an undo added to the undostack of t...
Definition elementsmover.cpp:169
void continueMovement(const QPointF &)
ElementsMover::continueMovement Add a move to the current movement.
Definition elementsmover.cpp:116
QPointer< QStatusBar > m_status_bar
Definition elementsmover.h:63
bool m_movement_running
Definition elementsmover.h:58
ElementsMover(const ElementsMover &)
Diagram * m_diagram
Definition elementsmover.h:60
DiagramContent m_moved_content
Definition elementsmover.h:62
virtual ~ElementsMover()
ElementsMover::~ElementsMover Destructor.
Definition elementsmover.cpp:42
QGraphicsItem * m_movement_driver
Definition elementsmover.h:61