summaryrefslogtreecommitdiffstats
path: root/framework
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-12-06 09:15:48 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-12-06 09:27:05 +0100
commitde670905b25f9af9e65d071025b8997fc0c0d39a (patch)
treea38ca95a636675ea2f84fd8acb61bd6fb82ee066 /framework
parentd1bbb364521710532076cd29f1911f07d89f9f5a (diff)
downloadkube-de670905b25f9af9e65d071025b8997fc0c0d39a.tar.gz
kube-de670905b25f9af9e65d071025b8997fc0c0d39a.zip
Fixed controller clear function
Adding a property from QML changes the offset from 1 to 20 for the composercontroller, which results in the clear function not working. Since we know that QObjects property offset is 1, we can just hardcode that number. Not the cleanest solution, so it would be good to find a better approach at some point.
Diffstat (limited to 'framework')
-rw-r--r--framework/src/domain/controller.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/framework/src/domain/controller.cpp b/framework/src/domain/controller.cpp
index 82a761f6..21dbb69a 100644
--- a/framework/src/domain/controller.cpp
+++ b/framework/src/domain/controller.cpp
@@ -46,7 +46,9 @@ void ControllerAction::execute()
46void Controller::clear() 46void Controller::clear()
47{ 47{
48 auto meta = metaObject(); 48 auto meta = metaObject();
49 for (auto i = meta->propertyOffset(); i < meta->propertyCount(); i++) { 49 //FIXME meta->propertyOffset() changes as soon as we add a property from QML. We know that QObject has an offset of 1.
50 auto offset = 1;
51 for (auto i = offset; i < meta->propertyCount(); i++) {
50 auto property = meta->property(i); 52 auto property = meta->property(i);
51 setProperty(property.name(), QVariant()); 53 setProperty(property.name(), QVariant());
52 } 54 }