Sun, 29 Aug 2021 22:14:42 +0300
added a simple matrix transformation tool
6 | 1 | #include <QBrush> |
3 | 2 | #include "errorline.h" |
3 | ||
35
98906a94732f
renamed the linetypes namespace to ldraw namespace and added more structures to it
Teemu Piippo <teemu@hecknology.net>
parents:
14
diff
changeset
|
4 | ldraw::ErrorLine::ErrorLine(QStringView text, QStringView message) : |
8
44679e468ba9
major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
5 | text{text.toString()}, |
44679e468ba9
major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
6 | message{message.toString()} |
3 | 7 | { |
8 | } | |
9 | ||
35
98906a94732f
renamed the linetypes namespace to ldraw namespace and added more structures to it
Teemu Piippo <teemu@hecknology.net>
parents:
14
diff
changeset
|
10 | QVariant ldraw::ErrorLine::getProperty(Property property) const |
3 | 11 | { |
12 | switch (property) | |
13 | { | |
14 | case Property::Text: | |
8
44679e468ba9
major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
15 | return this->text; |
44679e468ba9
major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
16 | case Property::ErrorMessage: |
44679e468ba9
major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
6
diff
changeset
|
17 | return this->message; |
3 | 18 | default: |
13 | 19 | return Object::getProperty(property); |
3 | 20 | } |
21 | } | |
22 | ||
86
4bec0525ef1b
PolygonObjectEditor can now modify the object properly
Teemu Piippo <teemu@hecknology.net>
parents:
35
diff
changeset
|
23 | void ldraw::ErrorLine::setProperty(SetPropertyResult* result, const PropertyKeyValue& pair) |
3 | 24 | { |
86
4bec0525ef1b
PolygonObjectEditor can now modify the object properly
Teemu Piippo <teemu@hecknology.net>
parents:
35
diff
changeset
|
25 | LDRAW_OBJECT_HANDLE_SET_PROPERTY(Text, {this->text = value;}); |
4bec0525ef1b
PolygonObjectEditor can now modify the object properly
Teemu Piippo <teemu@hecknology.net>
parents:
35
diff
changeset
|
26 | LDRAW_OBJECT_HANDLE_SET_PROPERTY(ErrorMessage, {this->message = value;}); |
4bec0525ef1b
PolygonObjectEditor can now modify the object properly
Teemu Piippo <teemu@hecknology.net>
parents:
35
diff
changeset
|
27 | BaseClass::setProperty(result, pair); |
3 | 28 | } |
6 | 29 | |
35
98906a94732f
renamed the linetypes namespace to ldraw namespace and added more structures to it
Teemu Piippo <teemu@hecknology.net>
parents:
14
diff
changeset
|
30 | QString ldraw::ErrorLine::textRepresentation() const |
6 | 31 | { |
32 | return this->text; | |
33 | } | |
34 | ||
35
98906a94732f
renamed the linetypes namespace to ldraw namespace and added more structures to it
Teemu Piippo <teemu@hecknology.net>
parents:
14
diff
changeset
|
35 | QBrush ldraw::ErrorLine::textRepresentationForeground() const |
6 | 36 | { |
37 | return QBrush{Qt::yellow}; | |
38 | } | |
39 | ||
35
98906a94732f
renamed the linetypes namespace to ldraw namespace and added more structures to it
Teemu Piippo <teemu@hecknology.net>
parents:
14
diff
changeset
|
40 | QBrush ldraw::ErrorLine::textRepresentationBackground() const |
6 | 41 | { |
42 | return QBrush{Qt::red}; | |
43 | } |