From dfdbd70864d97d8961e02471f63a0107f41e4921 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 6 Dec 2017 09:49:46 +0100 Subject: Found the proper solution --- framework/src/domain/controller.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/framework/src/domain/controller.cpp b/framework/src/domain/controller.cpp index 21dbb69a..515cfab0 100644 --- a/framework/src/domain/controller.cpp +++ b/framework/src/domain/controller.cpp @@ -46,9 +46,8 @@ void ControllerAction::execute() void Controller::clear() { auto meta = metaObject(); - //FIXME meta->propertyOffset() changes as soon as we add a property from QML. We know that QObject has an offset of 1. - auto offset = 1; - for (auto i = offset; i < meta->propertyCount(); i++) { + //We want to get the offset for this class, but clear the properties of all subclasses (thus staticMetaObject for the offset) + for (auto i = staticMetaObject.propertyOffset(); i < meta->propertyCount(); i++) { auto property = meta->property(i); setProperty(property.name(), QVariant()); } -- cgit v1.2.3