Tue, 24 May 2022 16:11:10 +0300
more work on circle tool + cleanup
#pragma once #include <QMouseEvent> #include "../main.h" #include "../ui/canvas.h" class Document; class BaseTool : public QObject { Q_OBJECT public: BaseTool(Document* document); virtual QString name() const = 0; virtual QString toolTip() const = 0; virtual bool mouseClick(Canvas*, QMouseEvent*) { return false; } virtual bool mouseDoubleClicked(QMouseEvent*, QMouseEvent*) { return false; } virtual bool mouseMove(Document*, Canvas*, QMouseEvent*) { return false; } virtual bool keyReleased(Document*, Canvas*, QKeyEvent*) { return false; } virtual QWidget* toolWidget() { return nullptr; } virtual void selectionChanged(const QSet<ldraw::id_t>&) {} virtual void reset() {} virtual void overpaint(Canvas*, QPainter*) const {} virtual QString iconName() const; Q_SIGNALS: void desiredGridChange(const glm::mat4& matrix); protected: QWidget* const parentWidget; Document* const document; };