Tue, 28 Sep 2021 23:07:23 +0300
Use QSaveFile to save the file more safely
81
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
1 | #pragma once |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
2 | #include <QWidget> |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
3 | #include "main.h" |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
4 | |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
5 | namespace Ui |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
6 | { |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
7 | class Vec3Editor; |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
8 | } |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
9 | |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
10 | class Vec3Editor : public QWidget |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
11 | { |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
12 | Q_OBJECT |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
13 | public: |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
14 | enum Flag |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
15 | { |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
16 | NoMultiplyButton = 0x1 |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
17 | }; |
105
6ca6e8c647d4
added preview layer code and fixed build warnings
Teemu Piippo <teemu@hecknology.net>
parents:
83
diff
changeset
|
18 | explicit Vec3Editor(const glm::vec3& value, QWidget* parent = nullptr, QFlags<Flag> flags = {}); |
81
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
19 | ~Vec3Editor(); |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
20 | glm::vec3 value() const; |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
21 | void setValue(const glm::vec3& value); |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
22 | Q_SIGNALS: |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
23 | void valueChanged(const glm::vec3& value); |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
24 | private: |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
25 | std::array<class DoubleSpinBox*, 3> spinboxes(); |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
26 | Q_SLOT void multiplyPressed(); |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
27 | std::unique_ptr<Ui::Vec3Editor> ui; |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
28 | }; |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
29 | |
62373840e33a
object editor widgets start to form up
Teemu Piippo <teemu@hecknology.net>
parents:
diff
changeset
|
30 | Q_DECLARE_OPERATORS_FOR_FLAGS(QFlags<Vec3Editor::Flag>) |