diff -r 06a1aef170aa -r 165777a20dc7 src/tools/basetool.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/tools/basetool.h Sun Jan 10 15:28:44 2021 +0200 @@ -0,0 +1,26 @@ +#pragma once +#include "../main.h" + +class BaseTool : public QObject +{ + Q_OBJECT + +public: + struct MouseEventData + { + QMouseEvent* ev; + Qt::KeyboardModifiers keymods; + bool mouseMoved; + Qt::MouseButtons releasedButtons; + }; + + BaseTool(QObject* parent = nullptr); + + virtual QString name() const = 0; + virtual QString toolTip() const = 0; + virtual bool mousePressed(QMouseEvent*) { return false; } + virtual bool mouseReleased(MouseEventData const&) { return false; } + virtual bool mouseDoubleClicked(QMouseEvent*) { return false; } + virtual bool mouseMoved(QMouseEvent*) { return false; } + virtual bool keyReleased(QKeyEvent*) { return false; } +};