QElectroTech  0.70
diagrameventaddshape.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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 "diagrameventinterface.h"
22 #include "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
QetShapeItem::ShapeType m_shape_type
DiagramEventAddShape(Diagram *diagram, QetShapeItem::ShapeType shape_type)
DiagramEventAddShape::DiagramEventAddShape Default constructor.
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddShape::mouseDoubleClickEvent Action when mouse button is double clicked.
QGraphicsLineItem * m_help_verti
void updateHelpCross(const QPointF &p)
DiagramEventAddShape::updateHelpCross Create and update the position of the cross to help user for dr...
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddShape::mouseMoveEvent Action when mouse move.
The DiagramEventAddShape class This event manage the creation of a shape.
~DiagramEventAddShape() override
DiagramEventAddShape::~DiagramEventAddShape.
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddShape::mouseReleaseEvent Action when mouse button is released.
The QetShapeItem class this class is used to draw a basic shape (line, rectangle, ellipse) into a dia...
Definition: qetshapeitem.h:35
The DiagramEventInterface class isRunning() return true if action is running (do something). By default return false.
QGraphicsLineItem * m_help_horiz
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddShape::mousePressEvent Action when mouse is pressed.