QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
diagrameventaddshape.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 DIAGRAMEVENTADDSHAPE_H
19#define DIAGRAMEVENTADDSHAPE_H
20
21#include "../qetgraphicsitem/qetshapeitem.h"
23
29{
30 Q_OBJECT
31
32 public:
34
35 ~DiagramEventAddShape() override;
36 void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
37 void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override;
38 void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override;
39 void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override;
40 void init() override;
41
42 private:
43 void updateHelpCross (const QPointF &p);
44
45 protected:
48 QGraphicsLineItem *m_help_horiz, *m_help_verti;
49};
50
51#endif // DIAGRAMEVENTADDSHAPE_H
The DiagramEventAddShape class This event manage the creation of a shape.
Definition diagrameventaddshape.h:29
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddShape::mousePressEvent Action when mouse is pressed.
Definition diagrameventaddshape.cpp:62
QetShapeItem::ShapeType m_shape_type
Definition diagrameventaddshape.h:46
~DiagramEventAddShape() override
DiagramEventAddShape::~DiagramEventAddShape.
Definition diagrameventaddshape.cpp:43
QetShapeItem * m_shape_item
Definition diagrameventaddshape.h:47
void init() override
Definition diagrameventaddshape.cpp:201
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddShape::mouseReleaseEvent Action when mouse button is released.
Definition diagrameventaddshape.cpp:136
void updateHelpCross(const QPointF &p)
DiagramEventAddShape::updateHelpCross Create and update the position of the cross to help user for dr...
Definition diagrameventaddshape.cpp:212
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddShape::mouseMoveEvent Action when mouse move.
Definition diagrameventaddshape.cpp:115
QGraphicsLineItem * m_help_horiz
Definition diagrameventaddshape.h:48
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddShape::mouseDoubleClickEvent Action when mouse button is double clicked.
Definition diagrameventaddshape.cpp:178
QGraphicsLineItem * m_help_verti
Definition diagrameventaddshape.h:48
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
The QetShapeItem class this class is used to draw a basic shape (line, rectangle, ellipse) into a dia...
Definition qetshapeitem.h:37
ShapeType
Definition qetshapeitem.h:58