src/linetypes/object.cpp

changeset 89
7abaf1d64719
parent 86
4bec0525ef1b
child 132
488d0ba6070b
equal deleted inserted replaced
88:14e51640c189 89:7abaf1d64719
1 #include <QBrush> 1 #include <QBrush>
2 #include <QFont> 2 #include <QFont>
3 #include "object.h" 3 #include "object.h"
4 #include "widgets/vec3editor.h"
5 #include "modeleditcontext.h"
4 6
5 static std::int32_t getIdForNewObject() 7 static std::int32_t getIdForNewObject()
6 { 8 {
7 static std::int32_t id = 0; 9 static std::int32_t id = 0;
8 id += 1; 10 id += 1;
85 QVariant ldraw::ColoredObject::getProperty(Property id) const 87 QVariant ldraw::ColoredObject::getProperty(Property id) const
86 { 88 {
87 switch (id) 89 switch (id)
88 { 90 {
89 case Property::Color: 91 case Property::Color:
90 return colorIndex.index; 92 return QVariant::fromValue<Color>(colorIndex);
91 default: 93 default:
92 return Object::getProperty(id); 94 return Object::getProperty(id);
93 } 95 }
94 } 96 }
95 97
96 void ldraw::ColoredObject::setProperty(SetPropertyResult* result, const PropertyKeyValue& pair) 98 void ldraw::ColoredObject::setProperty(SetPropertyResult* result, const PropertyKeyValue& pair)
97 { 99 {
98 LDRAW_OBJECT_HANDLE_SET_PROPERTY(Color, {colorIndex.index = value;}); 100 LDRAW_OBJECT_HANDLE_SET_PROPERTY(Color, {colorIndex = value;});
99 Object::setProperty(result, pair); 101 Object::setProperty(result, pair);
100 } 102 }
101 103
102 QString ldraw::Empty::textRepresentation() const 104 QString ldraw::Empty::textRepresentation() const
103 { 105 {

mercurial