src/modeleditcontext.cpp

Sun, 03 Nov 2019 13:07:04 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 03 Nov 2019 13:07:04 +0200
changeset 10
e249d97c7fe6
parent 8
44679e468ba9
child 13
6e838748867b
permissions
-rw-r--r--

fixed translations being updated twice at the same time, that's bad

3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 #include "modeleditcontext.h"
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3 Model::EditContext::EditContext(Model& model) :
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4 model{model}
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 {
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 }
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
8 void Model::EditContext::append(std::unique_ptr<modelobjects::BaseObject>&& object)
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
9 {
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
10 this->model.append(std::move(object));
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
11 }
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
12
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 void Model::EditContext::setObjectProperty(
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 modelobjects::BaseObject* object,
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15 modelobjects::Property property,
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 const QVariant& value)
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
17 {
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18 object->setProperty(property, value);
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 }

mercurial