QElectroTech  0.8-dev
diagrameventaddimage.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 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 DIAGRAMEVENTADDIMAGE_H
19 #define DIAGRAMEVENTADDIMAGE_H
20 
21 #include "diagrameventinterface.h"
22 
23 class Diagram;
24 class DiagramImageItem;
25 
31 {
32  Q_OBJECT
33 
34  public:
35  DiagramEventAddImage(Diagram *diagram);
36  ~DiagramEventAddImage() override;
37 
38  void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
39  void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override;
40  void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override;
41  void wheelEvent (QGraphicsSceneWheelEvent *event) override;
42 
43  bool isNull () const;
44  private:
45  void openDialog();
46 
48  bool m_is_added;
49 };
50 
51 #endif // DIAGRAMEVENTADDIMAGE_H
DiagramEventAddImage::m_image
DiagramImageItem * m_image
Definition: diagrameventaddimage.h:47
DiagramEventInterface::m_diagram
Diagram * m_diagram
Definition: diagrameventinterface.h:66
DiagramEventInterface::finish
void finish()
diagramcommands.h
diagrameventaddimage.h
Diagram::addItem
virtual void addItem(QGraphicsItem *item)
Diagram::addItem Réimplemented from QGraphicsScene::addItem(QGraphicsItem *item) Do some specific ope...
Definition: diagram.cpp:1550
Diagram::isEmpty
bool isEmpty() const
Diagram::isEmpty An empty schema contains no element, conductor, or text field.
Definition: diagram.cpp:680
DiagramEventAddImage::DiagramEventAddImage
DiagramEventAddImage(Diagram *diagram)
DiagramEventAddImage::DiagramEventAddImage Default constructor.
Definition: diagrameventaddimage.cpp:29
DiagramEventAddImage::mousePressEvent
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddImage::mousePressEvent Action when mouse is pressed.
Definition: diagrameventaddimage.cpp:57
DiagramImageItem
Definition: diagramimageitem.h:31
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
DiagramImageItem::boundingRect
QRectF boundingRect() const override
DiagramImageItem::boundingRect the outer bounds of the item as a rectangle, if no pixmap are set,...
Definition: diagramimageitem.cpp:109
DiagramEventAddImage::m_is_added
bool m_is_added
Definition: diagrameventaddimage.h:48
Diagram::removeItem
virtual void removeItem(QGraphicsItem *item)
Diagram::removeItem Reimplemented from QGraphicsScene::removeItem(QGraphicsItem *item) Do some specif...
Definition: diagram.cpp:1581
AddItemCommand
The AddItemCommand class This command add an item in a diagram The item to add is template,...
Definition: diagramcommands.h:42
DiagramEventAddImage::isNull
bool isNull() const
DiagramEventAddImage::isNull.
Definition: diagrameventaddimage.cpp:142
diagrameventinterface.h
DiagramEventAddImage::wheelEvent
void wheelEvent(QGraphicsSceneWheelEvent *event) override
DiagramEventAddImage::wheelEvent Action when mouse wheel is rotate.
Definition: diagrameventaddimage.cpp:123
DiagramEventAddImage::~DiagramEventAddImage
~DiagramEventAddImage() override
DiagramEventAddImage::~DiagramEventAddImage.
Definition: diagrameventaddimage.cpp:40
DiagramEventAddImage::mouseDoubleClickEvent
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddImage::mouseDoubleClickEvent This method is only use to overwrite double click....
Definition: diagrameventaddimage.cpp:114
DiagramEventInterface::m_running
bool m_running
Definition: diagrameventinterface.h:67
DiagramEventAddImage::mouseMoveEvent
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddImage::mouseMoveEvent Action when mouse move.
Definition: diagrameventaddimage.cpp:86
QET::QetMessageBox::critical
QMessageBox::StandardButton critical(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
Definition: qetmessagebox.cpp:23
DiagramEventInterface::m_abort
bool m_abort
Definition: diagrameventinterface.h:68
DiagramEventAddImage::openDialog
void openDialog()
DiagramEventAddImage::openDialog Open dialog for select the image to add.
Definition: diagrameventaddimage.cpp:152
DiagramEventAddImage
The DiagramEventAddImage class This diagram event, handle the adding of an image in a diagram.
Definition: diagrameventaddimage.h:31
DiagramEventInterface
The DiagramEventInterface class isRunning() return true if action is running (do something)....
Definition: diagrameventinterface.h:46
QetGraphicsItem::setPos
virtual void setPos(const QPointF &p)
Definition: qetgraphicsitem.cpp:49
diagramimageitem.h
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
diagram.h