Walls And Holes  1
abstracttool.h
Go to the documentation of this file.
1 #ifndef TOOL_H
2 #define TOOL_H
3 
4 #include <QMouseEvent>
5 #include <QWheelEvent>
6 #include <QAction>
7 #include <QObject>
8 
24 class AbstractTool : public QObject
25 {
26 public:
27  virtual ~AbstractTool() {}
28 
29 
33  virtual void activate() {}
34 
38  virtual void deactivate() {}
39 
44  virtual QList<QAction *> contextActions() { return {}; }
45 
46 
47  virtual void mousePressEvent(QMouseEvent *) {}
48  virtual void mouseReleaseEvent(QMouseEvent *) {}
49  virtual void mouseMoveEvent(QMouseEvent *) {}
50  virtual void wheelEvent(QWheelEvent *) {}
51 };
52 
53 #endif // TOOL_H
virtual void mouseMoveEvent(QMouseEvent *)
Definition: abstracttool.h:49
virtual void mousePressEvent(QMouseEvent *)
Definition: abstracttool.h:47
virtual void deactivate()
Deactivates the tool. This is called before the tool stops being used.
Definition: abstracttool.h:38
virtual QList< QAction * > contextActions()
Returns a vector of qactions which can be used to modify the behaviour of the tool. Will be used by the tool manager to add the actions to a context tool bar.
Definition: abstracttool.h:44
virtual void activate()
Activates the tool. This is called before the tool is used.
Definition: abstracttool.h:33
The AbstractTool class represents a UI tool. A UI tool can be activated or deactivated.
Definition: abstracttool.h:24
virtual void wheelEvent(QWheelEvent *)
Definition: abstracttool.h:50
virtual ~AbstractTool()
Definition: abstracttool.h:27
virtual void mouseReleaseEvent(QMouseEvent *)
Definition: abstracttool.h:48