src/linetypes/metacommand.cpp

Sat, 14 Dec 2019 23:00:01 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 14 Dec 2019 23:00:01 +0200
changeset 20
cef43609a374
parent 14
20d2ed3af73d
child 35
98906a94732f
permissions
-rw-r--r--

fixed build

8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 #include "metacommand.h"
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2
13
6e838748867b renamings
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
3 linetypes::MetaCommand::MetaCommand(QStringView text) :
6e838748867b renamings
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
4 Object{},
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 storedText{text.toString()} {}
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6
13
6e838748867b renamings
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
7 QVariant linetypes::MetaCommand::getProperty(Property property) const
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8 {
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 switch (property)
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 {
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11 case Property::Text:
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12 return storedText;
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 default:
13
6e838748867b renamings
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
14 return Object::getProperty(property);
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15 }
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 }
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
17
13
6e838748867b renamings
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
18 auto linetypes::MetaCommand::setProperty(Property property, const QVariant& value)
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 -> SetPropertyResult
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20 {
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 switch (property)
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22 {
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
23 case Property::Text:
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
24 storedText = value.toString();
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25 return SetPropertyResult::Success;
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26 default:
13
6e838748867b renamings
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
27 return Object::setProperty(property, value);
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
28 }
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
29 }
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
30
13
6e838748867b renamings
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
31 QString linetypes::MetaCommand::textRepresentation() const
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
32 {
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
33 return this->storedText;
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
34 }

mercurial