diff --git a/src/libs/vpropertyexplorer/vproperty.cpp b/src/libs/vpropertyexplorer/vproperty.cpp index 30be44c00..caab96b48 100644 --- a/src/libs/vpropertyexplorer/vproperty.cpp +++ b/src/libs/vpropertyexplorer/vproperty.cpp @@ -334,6 +334,7 @@ VProperty* VProperty::clone(bool include_children, VProperty* container) const container->setValue(getValue()); container->setSettings(getSettings()); container->setUpdateBehaviour(getUpdateParent(), getUpdateChildren()); + container->setPropertyType(propertyType()); if(include_children) { foreach(VProperty* tmpChild, d_ptr->Children) @@ -348,6 +349,11 @@ Property VProperty::propertyType() const return d_ptr->type; } +void VProperty::setPropertyType(const Property &type) +{ + d_ptr->type = type; +} + void VProperty::UpdateParent(const QVariant &value) { Q_UNUSED(value); diff --git a/src/libs/vpropertyexplorer/vproperty.h b/src/libs/vpropertyexplorer/vproperty.h index 2a433a9fd..b01531f86 100644 --- a/src/libs/vpropertyexplorer/vproperty.h +++ b/src/libs/vpropertyexplorer/vproperty.h @@ -162,6 +162,7 @@ public: virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const; Property propertyType() const; + void setPropertyType(const Property &type); virtual void UpdateParent(const QVariant &value); public slots: diff --git a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp index 9dcef9d9d..598fecdd8 100644 --- a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp +++ b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp @@ -164,18 +164,22 @@ void VPropertyFormWidget::commitData(int row) VProperty* tmpProperty = d_ptr->Properties[row]; if(tmpEditorWidget.FormWidget) tmpEditorWidget.FormWidget->commitData(); - else if(tmpEditorWidget.Editor && tmpProperty) { + else if(tmpEditorWidget.Editor && tmpProperty) + { QVariant newValue = tmpProperty->getEditorData(tmpEditorWidget.Editor); QVariant oldValue = tmpProperty->data(VProperty::DPC_Data, Qt::EditRole); if (oldValue != newValue) { - if (VProperty *parent = tmpProperty->getParent()) + VProperty *parent = tmpProperty->getParent(); + if (parent == nullptr) { - if (parent->propertyType() == Property::Complex) - { - tmpProperty->UpdateParent(newValue); - emit propertyDataSubmitted(parent); - } + tmpProperty->setValue(newValue); + emit propertyDataSubmitted(tmpProperty); + } + else if (parent->propertyType() == Property::Complex) + { + tmpProperty->UpdateParent(newValue); + emit propertyDataSubmitted(parent); } else {