QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
diagrameventaddelement.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 DIAGRAMEVENTADDELEMENT_H
19#define DIAGRAMEVENTADDELEMENT_H
20
21#include "../ElementsCollection/elementslocation.h"
23
24class Element;
25class QStatusBar;
26
33{
34 Q_OBJECT
35
36 public:
37 DiagramEventAddElement(ElementsLocation &location, Diagram *diagram, QPointF pos = QPointF(0,0));
38 ~DiagramEventAddElement() override;
39
40 void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override;
41 void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
42 void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override;
43 void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override;
44 void keyPressEvent (QKeyEvent *event) override;
45 void init() override;
46
47 private:
48 bool buildElement();
49 void addElement();
50
51 private:
55 QPointer<QStatusBar> m_status_bar;
56};
57
58#endif // DIAGRAMEVENTADDELEMENT_H
The DiagramEventAddElement class This diagram event add a new element, for each left click button at ...
Definition diagrameventaddelement.h:33
QPointer< QStatusBar > m_status_bar
Definition diagrameventaddelement.h:55
Element * m_element
Definition diagrameventaddelement.h:53
bool buildElement()
DiagramEventAddElement::buildElement Build the element, if the element is build successfully,...
Definition diagrameventaddelement.cpp:198
void init() override
DiagramEventAddElement::init Init this event.
Definition diagrameventaddelement.cpp:188
~DiagramEventAddElement() override
DiagramEventAddElement::~DiagramEventAddElement Destructor Enable context menu for each view of diagr...
Definition diagrameventaddelement.cpp:72
ElementsLocation m_location
Definition diagrameventaddelement.h:52
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddElement::mouseReleaseEvent Right button finish this event (isRunning = false) and emit...
Definition diagrameventaddelement.cpp:125
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddElement::mousePressEvent Do nothing, but return true for not transit the event to othe...
Definition diagrameventaddelement.cpp:114
void keyPressEvent(QKeyEvent *event) override
DiagramEventAddElement::keyPressEvent Press space key rotate the element to 90° (return true) else ca...
Definition diagrameventaddelement.cpp:172
QString m_integrate_path
Definition diagrameventaddelement.h:54
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddElement::mouseMoveEvent Move the element to new pos of mouse the event is always accep...
Definition diagrameventaddelement.cpp:94
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddElement::mouseDoubleClickEvent If mouse left double clic, finish this event (isRunning...
Definition diagrameventaddelement.cpp:152
void addElement()
DiagramEventAddElement::addElement Add an element at the current pos en current rotation,...
Definition diagrameventaddelement.cpp:226
The DiagramEventInterface class isRunning() return true if action is running (do something)....
Definition diagrameventinterface.h:47
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition element.h:43
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition elementslocation.h:47