src/tools/basetool.h

Mon, 19 Jul 2021 23:41:52 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Mon, 19 Jul 2021 23:41:52 +0300
changeset 105
6ca6e8c647d4
parent 104
cd4df75924b7
child 106
128efb9d148b
permissions
-rw-r--r--

added preview layer code and fixed build warnings

#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; }
};

mercurial