diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2011-07-28 23:59:21 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2011-07-29 00:00:24 +0200 |
commit | 016f7f2a57dbb776846a511e06e03b2e2572ab7c (patch) | |
tree | 1b04cce78d92ffcf540063f6dd54c8270b298cf8 /dgedit/canvastool.h | |
parent | 11ae33c3b0a0cbad772b23eb7d0714eef8ab9b03 (diff) |
First attemt on the selections tool in the new CanvasTool structure.
Diffstat (limited to 'dgedit/canvastool.h')
-rw-r--r-- | dgedit/canvastool.h | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/dgedit/canvastool.h b/dgedit/canvastool.h index bd224d0..0e802ba 100644 --- a/dgedit/canvastool.h +++ b/dgedit/canvastool.h @@ -27,40 +27,31 @@ #ifndef __DRUMGIZMO_CANVASTOOL_H__ #define __DRUMGIZMO_CANVASTOOL_H__ +#include <QMouseEvent> +#include <QResizeEvent> +#include <QPaintEvent> +#include <QKeyEvent> +#include <QPainter> + class CanvasTool : public QObject { Q_OBJECT public: - virtual void mouseMoveEvent(QMouseEvent *event) = 0; - virtual void mousePressEvent(QMouseEvent *event) = 0; - virtual void mouseReleaseEvent(QMouseEvent *event) = 0; - virtual void resizeEvent(QResizeEvent *event) = 0; - virtual void paintEvent(QPaintEvent *event) = 0; - virtual void keyReleaseEvent(QKeyEvent *event) = 0; + virtual bool mouseMoveEvent(QMouseEvent *event); + virtual bool mousePressEvent(QMouseEvent *event); + virtual bool mouseReleaseEvent(QMouseEvent *event); + virtual void resizeEvent(QResizeEvent *event); + virtual void paintEvent(QPaintEvent *event, QPainter &painter); + virtual void keyReleaseEvent(QKeyEvent *event); + + bool isActive(); signals: void activateChanged(bool activestate); public slots: - void setActive(bool active) - { - _active = active; - emit activateChanged(active); - } - - void activate() - { - setActive(true); - } - - void disactivate() - { - setActive(false); - } - - bool isActive() - { - return _active; - } + void setActive(bool active); + void activate(); + void disactivate(); private: bool _active; |