src/objecttypes/metacommand.cpp

changeset 8
44679e468ba9
child 13
6e838748867b
equal deleted inserted replaced
7:68443f5be176 8:44679e468ba9
1 #include "metacommand.h"
2
3 modelobjects::MetaCommand::MetaCommand(QStringView text) :
4 BaseObject{},
5 storedText{text.toString()} {}
6
7 QVariant modelobjects::MetaCommand::getProperty(Property property) const
8 {
9 switch (property)
10 {
11 case Property::Text:
12 return storedText;
13 default:
14 return BaseObject::getProperty(property);
15 }
16 }
17
18 auto modelobjects::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 BaseObject::setProperty(property, value);
28 }
29 }
30
31 QString modelobjects::MetaCommand::textRepresentation() const
32 {
33 return this->storedText;
34 }

mercurial