Tue, 28 Sep 2021 23:07:23 +0300
Use QSaveFile to save the file more safely
127
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
1 | #pragma once |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
2 | #include <QPushButton> |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
3 | #include "basetool.h" |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
4 | #include "widgets/matrixeditor.h" |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
5 | |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
6 | class TransformTool : public BaseTool |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
7 | { |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
8 | Q_OBJECT |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
9 | public: |
143
7b62c52835a1
Fix memory corruption involving document tools.
Teemu Piippo <teemu@hecknology.net>
parents:
127
diff
changeset
|
10 | Q_INVOKABLE TransformTool(Model *model, QWidget *parent = nullptr); |
127
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
11 | virtual QString name() const override; |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
12 | virtual QString toolTip() const override; |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
13 | void selectionChanged(const QSet<ldraw::id_t> &newSelection) override; |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
14 | QWidget *toolWidget() override; |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
15 | private: |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
16 | Q_SLOT void applyButtonClicked(); |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
17 | Model* const model; |
143
7b62c52835a1
Fix memory corruption involving document tools.
Teemu Piippo <teemu@hecknology.net>
parents:
127
diff
changeset
|
18 | MatrixEditor* matrixEditor; |
127
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
19 | QPushButton* button; |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
20 | QWidget* widget; |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
21 | QSet<ldraw::id_t> selection; |
f64bfb7f5d26
added a simple matrix transformation tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
22 | }; |