diff --git a/src/KProperty.cpp b/src/KProperty.cpp --- a/src/KProperty.cpp +++ b/src/KProperty.cpp @@ -522,6 +522,9 @@ KProperty::setOption(const char* name, const QVariant& val) { d->options[name] = val; + if (d->composed) { + d->composed->setOption(this, name, val); + } } QVariant diff --git a/src/KPropertyFactory.h b/src/KPropertyFactory.h --- a/src/KPropertyFactory.h +++ b/src/KPropertyFactory.h @@ -47,6 +47,8 @@ useComposedProperty (the third parameter) to false, or there will be infinite recursion. */ virtual void setValue(KProperty *property, const QVariant &value, bool rememberOldValue) = 0; + virtual void setOption(KProperty *property, const char* name, const QVariant& val); + void childValueChangedInternal(KProperty *child, const QVariant &value, bool rememberOldValue) { if (m_childValueChangedEnabled) childValueChanged(child, value, rememberOldValue); diff --git a/src/KPropertyFactory.cpp b/src/KPropertyFactory.cpp --- a/src/KPropertyFactory.cpp +++ b/src/KPropertyFactory.cpp @@ -278,10 +278,17 @@ { } +void KComposedPropertyInterface::setOption(KProperty *property, const char* name, const QVariant& val) +{ + Q_UNUSED(name) + Q_UNUSED(val); +} + KComposedPropertyCreatorInterface::KComposedPropertyCreatorInterface() { } KComposedPropertyCreatorInterface::~KComposedPropertyCreatorInterface() { } + diff --git a/src/editors/pointfedit.h b/src/editors/pointfedit.h --- a/src/editors/pointfedit.h +++ b/src/editors/pointfedit.h @@ -33,6 +33,8 @@ virtual void setValue(KProperty *property, const QVariant &value, bool rememberOldValue); + virtual void setOption(KProperty *property, const char * name, const QVariant & val) override; + virtual void childValueChanged(KProperty *child, const QVariant &value, bool rememberOldValue); }; diff --git a/src/editors/pointfedit.cpp b/src/editors/pointfedit.cpp --- a/src/editors/pointfedit.cpp +++ b/src/editors/pointfedit.cpp @@ -66,6 +66,13 @@ property->child("y")->setValue(p.y(), rememberOldValue, false); } +void KPointFComposedProperty::setOption(KProperty *property, const char *name, const QVariant &val) +{ + qDebug() << "Received option for pointf" << name << val; + property->child("x")->setOption(name, val); + property->child("y")->setOption(name, val); +} + void KPointFComposedProperty::childValueChanged(KProperty *child, const QVariant &value, bool rememberOldValue) {