Fri, 17 Sep 2021 22:43:22 +0300
add missing change to document.cpp
96 | 1 | #pragma once |
100 | 2 | #include <QMouseEvent> |
96 | 3 | #include "../main.h" |
104 | 4 | #include "../ui/canvas.h" |
96 | 5 | |
111
1f42c03fafca
Draw tool actually adds objects now
Teemu Piippo <teemu@hecknology.net>
parents:
109
diff
changeset
|
6 | class Document; |
1f42c03fafca
Draw tool actually adds objects now
Teemu Piippo <teemu@hecknology.net>
parents:
109
diff
changeset
|
7 | |
96 | 8 | class BaseTool : public QObject |
9 | { | |
10 | Q_OBJECT | |
11 | ||
12 | public: | |
126
a7c720aff97c
moved ObjectEditor under SelectTool
Teemu Piippo <teemu@hecknology.net>
parents:
125
diff
changeset
|
13 | BaseTool(Model* model, QObject* parent = nullptr); |
96 | 14 | |
15 | virtual QString name() const = 0; | |
16 | virtual QString toolTip() const = 0; | |
121
000781318c36
added right click support for draw tool
Teemu Piippo <teemu@hecknology.net>
parents:
111
diff
changeset
|
17 | virtual bool mouseClick(Document*, Canvas*, QMouseEvent*) { return false; } |
000781318c36
added right click support for draw tool
Teemu Piippo <teemu@hecknology.net>
parents:
111
diff
changeset
|
18 | virtual bool mouseDoubleClicked(QMouseEvent*, QMouseEvent*) { return false; } |
000781318c36
added right click support for draw tool
Teemu Piippo <teemu@hecknology.net>
parents:
111
diff
changeset
|
19 | virtual bool mouseMove(Document*, Canvas*, QMouseEvent*) { return false; } |
125
f127982d3412
Move tools under Document instead of MainWindow
Teemu Piippo <teemu@hecknology.net>
parents:
121
diff
changeset
|
20 | virtual bool keyReleased(Document*, Canvas*, QKeyEvent*) { return false; } |
126
a7c720aff97c
moved ObjectEditor under SelectTool
Teemu Piippo <teemu@hecknology.net>
parents:
125
diff
changeset
|
21 | virtual QWidget* toolWidget() { return nullptr; } |
a7c720aff97c
moved ObjectEditor under SelectTool
Teemu Piippo <teemu@hecknology.net>
parents:
125
diff
changeset
|
22 | virtual void selectionChanged(const QSet<ldraw::id_t>&) {} |
106 | 23 | virtual void reset() {} |
109
40a1cf2f38f5
replaced preview layers in favor of overpainting callback
Teemu Piippo <teemu@hecknology.net>
parents:
108
diff
changeset
|
24 | virtual void overpaint(Canvas*, QPainter*) const {} |
96 | 25 | }; |
103 | 26 |