src/tools/basetool.h

Sat, 24 Jul 2021 01:50:38 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 24 Jul 2021 01:50:38 +0300
changeset 107
02f142b399b1
parent 106
128efb9d148b
child 108
94c92c923713
permissions
-rw-r--r--

Move selection logic into select tool

#pragma once
#include <QMouseEvent>
#include "../main.h"
#include "../ui/canvas.h"

class BaseTool : public QObject
{
	Q_OBJECT

public:
	BaseTool(QObject* parent = nullptr);

	virtual QString name() const = 0;
	virtual QString toolTip() const = 0;
	virtual bool mousePressed(QMouseEvent*) { return false; }
	virtual bool mouseClick(const Canvas::MouseClickInfo&) { return false; }
	virtual bool mouseDoubleClicked(QMouseEvent*) { return false; }
	virtual bool mouseMoved(QMouseEvent*) { return false; }
	virtual bool keyReleased(QKeyEvent*) { return false; }
	virtual void reset() {}
};

mercurial