QElectroTech  0.70
dveventinterface.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 DVEVENTINTERFACE_H
19 #define DVEVENTINTERFACE_H
20 
21 #include <QObject>
22 
23 class QMouseEvent;
24 class QWheelEvent;
25 class QKeyEvent;
26 class DiagramView;
27 class Diagram;
28 
38 class DVEventInterface : public QObject
39 {
40  Q_OBJECT
41 
42  public:
44  ~DVEventInterface () override = 0;
45  virtual bool mouseDoubleClickEvent (QMouseEvent *event);
46  virtual bool mousePressEvent (QMouseEvent *event);
47  virtual bool mouseMoveEvent (QMouseEvent *event);
48  virtual bool mouseReleaseEvent (QMouseEvent *event);
49  virtual bool wheelEvent (QWheelEvent *event);
50  virtual bool keyPressEvent (QKeyEvent *event);
51  virtual bool KeyReleaseEvent (QKeyEvent *event);
52  virtual bool isRunning () const;
53  virtual bool isFinish () const;
54 
55  signals:
60  void finish();
61 
62  protected:
65  bool m_running;
66  bool m_abort;
67 };
68 
69 #endif // DVEVENTINTERFACE_H
~DVEventInterface() override=0
virtual bool keyPressEvent(QKeyEvent *event)
DVEventInterface::keyPressEvent By default, press escape key abort the curent action. isFinish return true, and emit finish.
virtual bool isRunning() const
virtual bool mouseDoubleClickEvent(QMouseEvent *event)
virtual bool KeyReleaseEvent(QKeyEvent *event)
virtual bool mouseReleaseEvent(QMouseEvent *event)
void finish()
finish emited when the interface finish is work
The DVEventInterface class This class is the main interface for manage event of a Diagram View...
virtual bool mouseMoveEvent(QMouseEvent *event)
virtual bool wheelEvent(QWheelEvent *event)
virtual bool mousePressEvent(QMouseEvent *event)
virtual bool isFinish() const
DiagramView * m_dv
DVEventInterface(DiagramView *dv)