src/objecttypes/metacommand.cpp

changeset 14
20d2ed3af73d
parent 13
6e838748867b
child 15
9e18ec63eec3
equal deleted inserted replaced
13:6e838748867b 14:20d2ed3af73d
1 #include "metacommand.h"
2
3 linetypes::MetaCommand::MetaCommand(QStringView text) :
4 Object{},
5 storedText{text.toString()} {}
6
7 QVariant linetypes::MetaCommand::getProperty(Property property) const
8 {
9 switch (property)
10 {
11 case Property::Text:
12 return storedText;
13 default:
14 return Object::getProperty(property);
15 }
16 }
17
18 auto linetypes::MetaCommand::setProperty(Property property, const QVariant& value)
19 -> SetPropertyResult
20 {
21 switch (property)
22 {
23 case Property::Text:
24 storedText = value.toString();
25 return SetPropertyResult::Success;
26 default:
27 return Object::setProperty(property, value);
28 }
29 }
30
31 QString linetypes::MetaCommand::textRepresentation() const
32 {
33 return this->storedText;
34 }

mercurial