QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
dveventinterface.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 DVEVENTINTERFACE_H
19#define DVEVENTINTERFACE_H
20
21#include <QObject>
22
23class QMouseEvent;
24class QWheelEvent;
25class QKeyEvent;
26class DiagramView;
27class Diagram;
28
42class DVEventInterface : public QObject
43{
44 Q_OBJECT
45
46 public:
48 ~DVEventInterface () override = 0;
49 virtual bool mouseDoubleClickEvent (QMouseEvent *event);
50 virtual bool mousePressEvent (QMouseEvent *event);
51 virtual bool mouseMoveEvent (QMouseEvent *event);
52 virtual bool mouseReleaseEvent (QMouseEvent *event);
53 virtual bool wheelEvent (QWheelEvent *event);
54 virtual bool keyPressEvent (QKeyEvent *event);
55 virtual bool KeyReleaseEvent (QKeyEvent *event);
56 virtual bool isRunning () const;
57 virtual bool isFinish () const;
58
59 signals:
64 void finish();
65
66 protected:
70 bool m_abort;
71};
72
73#endif // DVEVENTINTERFACE_H
The DVEventInterface class This class is the main interface for manage event of a Diagram View....
Definition dveventinterface.h:43
virtual bool KeyReleaseEvent(QKeyEvent *event)
Definition dveventinterface.cpp:81
bool m_running
Definition dveventinterface.h:69
~DVEventInterface() override=0
Definition dveventinterface.cpp:33
virtual bool keyPressEvent(QKeyEvent *event)
DVEventInterface::keyPressEvent By default, press escape key abort the current action....
Definition dveventinterface.cpp:69
void finish()
finish emitted when the interface finishes its job
virtual bool isFinish() const
Definition dveventinterface.cpp:91
bool m_abort
Definition dveventinterface.h:70
virtual bool mouseDoubleClickEvent(QMouseEvent *event)
Definition dveventinterface.cpp:37
Diagram * m_diagram
Definition dveventinterface.h:68
virtual bool isRunning() const
Definition dveventinterface.cpp:86
virtual bool wheelEvent(QWheelEvent *event)
Definition dveventinterface.cpp:57
virtual bool mousePressEvent(QMouseEvent *event)
Definition dveventinterface.cpp:42
DiagramView * m_dv
Definition dveventinterface.h:67
virtual bool mouseMoveEvent(QMouseEvent *event)
Definition dveventinterface.cpp:47
virtual bool mouseReleaseEvent(QMouseEvent *event)
Definition dveventinterface.cpp:52
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition diagramview.h:39